|
juliette Salexa wrote:
> When I apply the command: format short , my numbers only arrive as 5 digit strings.
> When I apply the command:format long, my numbers arrive as massive 14 digit strings.
> I want to be able to customize this. Ideally I should be able to do something like:
> short=8 , and then: format short, would make my numbers have 8 digits instead of 5.
> Is there a way to do this in matlab?
No, there is no way to do that in Matlab, as the premise is incorrect. The 'format'
command affects only the display of values via disp() or by default output
(no semi-colon after an expression), and in no way affects the number of digits
that "arrive", and in no way affects the number of digits that are saved in .mat
files or that are saved via save -ascii, and in no way affects csvwrite() or
dlmwrite().
If your request is to change the format used by disp() or by default output,
to something not already supported by the 'format' command, then NO, there is
no way to do that.
> That response did NOT help me!!
That response did not help -us- to know what was not acceptable about using sprintf()
in your situation.
--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?
|