[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vectorizing fprintf?
From: |
Jaroslav Hajek |
Subject: |
Re: vectorizing fprintf? |
Date: |
Wed, 23 Jul 2008 10:58:42 +0200 |
On Wed, Jul 23, 2008 at 10:53 AM, Goebel, Juergen
<address@hidden> wrote:
>> Jaroslav Hajek wrote:
>
>> fprintf (fid, "\n(%6.3f,%6.3f)", [(1:n) / N, real(e(1:n))].')
>>
>> what you need?
>
> Not exactly.
>
> a = sprintf ("%i,%i", [(1:10), (11:20)].')
>
> shows the same result as
>
> a = sprintf ("%i,%i", (1:10), (11:20))
>
> and as
>
> a = sprintf ("%i,%i", [(1:10), (11:20)])
>
> 1,2 3,4 5,6 7,8 9,10 11,12 13,14 15,16 17,18 19,20
>
> What I need is
>
> 1,11 2,12 3,13 4,14 5,15 6,16 7,17 8,18 9,19 10,20
>
> though.
>
> Or did I misunderstand you?
>
> Jürgen
>
Oops, sorry. For some reason I thought that e is column vector (which
is a nonsense because then the expression I gave wouldn't work
anyway). Try:
a = sprintf ("%i,%i ", [(1:10); (11:20)])
and similarly with your first example.
regards
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz