Re: Question on number formatting



Steve Amphlett wrote:
>
>
> OA wrote:
>>
>>
>> I've got a matrix I'm trying to return data from and whenever I
> do
>> something like:
>>
>> mymatrix(1,:)
>>
>> I get:
>>
>> ans =
>> 1.0e+003 *
>>
>> [data in columns]
>>
>> Could someone tell me how I would get the data to appear in
their
>> original format rather than be divided by 1000? I've tried a
>> variety
>> of format('long'), etc. commands but these only appear to
effect
>> the
>> display after the decimal point.
>>
>> Can anyone tell me which format I'm looking for, please?
>
> You're going to need to supply a format to fprintf if you care
> about
> the visuals. For example:
>
> fprintf('%f\n',mymatrix(1,:))
>
> Otherwise your stuck with the default (which is a bit like %g)
Thanks for your reply, I knew there was something I was missing.
I'll give this a go.
.



Relevant Pages

  • Re: stop script if dates are missing, edit help...
    ... he wanted the ability to enter the start date in 1/1/2005 format and ... right on column J, which is K, if any of those are missing to print out ... msg box and basically stop and say: make sure the dates in the range ... Prev by Date: ...
    (microsoft.public.excel)
  • Re: Adding dates to get a date
    ... >I am trying to add two cells plus 30 and get a date. ... >Q7 and M7 are both in date format. ... I'm missing something, or not sure exactly what you want to do. ... Prev by Date: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: MYSql, CGI web page search code not working
    ... print MySQLdb.paramstyle returns: format ... But I get this in my Apache error log: ... that I am missing!! ... Prev by Date: ...
    (comp.lang.python)
  • Re: VB.NET Discussion
    ... It's interesting to note that while Format() is clearly a VBA function, Visual Basic isn't mentioned anywhere in at article (unless ... I'm missing the obvious). ... Prev by Date: ...
    (microsoft.public.vb.general.discussion)
  • Re: Question on number formatting
    ... Steve Amphlett wrote: ... Eventually, I won't care, but as I ... > I echo your sentiments, ... There is limited control of the output, see help format. ...
    (comp.soft-sys.matlab)