Why my var6 appear divide by 1000?
Show older comments
Hi, everyone i'm preparing a script for solve several things, among those the kmean, but i have noted that vector called "var6" appear divided by 1000, when i write in the command windows "disp(Var6)", but distinctly, the other five variables when i "disp" each one appear or are printed correctly as it are in spreedsheet of excel, can you help me to detect why var6 is divided by 1000?.
Finally, i need to detect the "hour" of each one of my 7 cluster, how can i do that?, for locate the tipical behaviour in every one of my 7 cluster of data.
Thanks in advance.
Accepted Answer
More Answers (1)
Steven Lord
on 6 Oct 2016
When you execute this code, does it look like what happens when your var6 variable is divided by 1000?
format
x = [1234.5 1234.56];
If so that's due to the display format. Above the two numbers in x that look like they've been divided by 1000 you should see something like "1.0e+03 * " -- that's the factor of 1000 that your believe is missing. If you change the display format to something else, like format shortg or format longg, the results may look close to what you expect. Note that changing the format DOES NOT change the actual values stored in the variable. It only changes how those values are displayed on the screen (or in a diary file or log file created by the -logfile startup option.)
format shortg
x = [1234.5 1234.56]
format longg
x = [1234.5 1234.56]
2 Comments
Tony Castillo
on 10 Oct 2016
Steven Lord
on 10 Oct 2016
The values in your other variables are either integer values or are small enough that they can be written in "Scaled fixed point format with 5 digits." without needing the factor to be extracted.
format
x = 12345678 % integer value
x = 1.23 % small enough
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!