Recent content by shwathshav

  1. S

    MATLAB MATLAB num2str: Preserving Valid Digits

    OK, confirmed: The the last number (1.195) shall be displayed as 1.20, otherwise a meticulous scientist looses information... :) num2str([1.105, 1.115, 1.125, 1.135, 1.145, 1.155, 1.165, 1.175, 1.185, 1.195],3) ans = 1.11 1.12 1.13 1.14 1.15 1.16 1.17...
  2. S

    MATLAB MATLAB num2str: Preserving Valid Digits

    I expected a failing around 1.15, but there is nothing surprising, IMO. A part of your idea: num2str([1.145, 1.155],2) ans = 1.1 1.2 IMO, it is OK. A new failing example: num2str([1.145, 1.150, 1.155],2) ans = 1.1 1.1 1.2 <=> rounding 1.15 to the first decimal place...
  3. S

    MATLAB MATLAB num2str: Preserving Valid Digits

    No, it does not handle for i=1:4 num2str([0.0056, 0.0060, 0.043, 0.050, 0.32, 0.40],i) end ans = 0.006 0.006 0.04 0.05 0.3 0.4ans = 0.0056 0.006 0.043 0.05 0.32 0.4ans = 0.0056 0.006 0.043 0.05 0.32 0.4ans = 0.0056 0.006...
  4. S

    MATLAB MATLAB num2str: Preserving Valid Digits

    Dear Users, the topic MATLAB num2str is closed, therefore I am posting this as a reply to that thread. The suggestion by marcusl won't work for numbers of various format, but same number of valid digits. Example: The numbers 0.0056 0.0060 0.043 0.050 0.32 0.40 are valid to their...
Back
Top