Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!feeder2.ecngs.de!ecngs!feeder.ecngs.de!border1.nntp.ams.giganews.com!nntp.giganews.com!news.panservice.it!feeder.news.tin.it!spool.news.tin.it!not-for-mail
From: "Elefante" <elefante@tiscalinet.it>
Newsgroups: comp.soft-sys.matlab
References: <49548a0b$0$1117$4fafbaef@reader3.news.tin.it> <gj3570$4pf$1@fred.mathworks.com>
Subject: Re: fprintf for Matrix
Date: Sat, 27 Dec 2008 07:44:25 +0100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-Antivirus: avast! (VPS 081226-0, 26/12/2008), Outbound message
X-Antivirus-Status: Clean
Lines: 43
Message-ID: <4955cecd$0$1115$4fafbaef@reader4.news.tin.it>
Organization: TIN.IT (http://www.tin.it)
X-Comments: Please send technical notifications to newsmaster@tin.it
NNTP-Posting-Host: 87.5.76.16
X-Trace: 1230360269 reader4.news.tin.it 1115 87.5.76.16:12657
X-Complaints-To: Please send abuse reports to abuse@retail.telecomitalia.it
Xref: news.mathworks.com comp.soft-sys.matlab:508870

        O.K. Thank You
        Bye


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> ha scritto nel 
messaggio news:gj3570$4pf$1@fred.mathworks.com...
> "Elefante" <elefante@tiscalinet.it> wrote in message 
> <49548a0b$0$1117$4fafbaef@reader3.news.tin.it>...
>>
>>         X=M(1:end,1);
>>         Y=M(1:end,2);
>>         Z=M(1:end,3);
>>
>>         fprintf('%14.3f\n',X);
>>         fprintf('%14.3f\n',Y);
>>         fprintf('%14.3f\n',Z);
>>
>>     The Resulted all right it's O.K.
>>         Because with:
>>
>>         fprintf('%14.3f %14.3f %14.3f\n',M);
>>
>>     or:
>>
>>         fprintf('%14.3f %14.3f %14.3f\n',X,Y,Z);
>>
>>     The Resulted it's NO  O.K., but different ?
>>     Thank you.
>
>  Your presentation is not very clear, but I am guessing you want the 
> values of M printed out in an arrangement similar to what you would get 
> with matlab's display of M.  If so, you should do it this way:
>
> fprintf('%14.3f %14.3f %14.3f\n',M(:,1:3).');
>
>  The reason is that 'fprintf' prints elements of matrix M in the order 
> they occur in M(:), that is in matlab's standard "column" order and what 
> you presumably want is "row" order, so a transpose is necessary.
>
> Roger Stafford
>