help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3d Matrices to ASCII


From: Andreas Weber
Subject: Re: 3d Matrices to ASCII
Date: Sun, 07 Dec 2014 16:20:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0

Hi Leland, please keep the list in CC so that the other users see that
your problem has been solved.

Am 05.12.2014 um 22:08 schrieb Leland Smith:
>> Date: Fri, 5 Dec 2014 20:48:04 +0100
>> From: address@hidden
>> Ah, you want
>> octave:> a = zeros (4, 3, 2); a(:) = 1:24;
>> octave:> b = reshape(permute(a, [1 3 2]), 4*2, [])
>> b =
>>
>> 1 5 9
>> 2 6 10
>> 3 7 11
>> 4 8 12
>> 13 17 21
>> 14 18 22
>> 15 19 23
>> 16 20 24
>>
>> save ("-ascii", "yourfile.csv", "b")
>>
>> Excel should be able to import this, right?
>>
>> In your 1522 x 6 x6 case I think you want
>>
>> b = reshape(permute(yourmatrix, [1 3 2]), 1522*6, [])
>> save ("-ascii", "yourmatrix.csv", "b")
>>
>>
>> -- Andy
> It's a miracle.  Thanks so much.  I don't understand the [1,3,2] in the
> permute command, though.  Just curious (or I wouldn't be doing
> engineering work at my age.)

-- Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]