help-octave
[Top][All Lists]
Advanced

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

Re: 3d Matrices to ASCII


From: Joao Rodrigues
Subject: Re: 3d Matrices to ASCII
Date: Fri, 05 Dec 2014 19:25:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 12/05/2014 07:13 PM, Leland Smith wrote:
I found a not pretty solution to my problem on some discussion site.  It is the save command with the -text option.  It results in a single column of the data such that in EXCEL one has to move the individual data columns around appropriately.  Not pretty, but it's the only thing I've found.

Dear Leland

Can you restate your problem? You want to go from a 3d float matrix in Octave to Excel or to ascii? I don't understand how you have a single column by printing a matrix.

To Excel you can use the io package (xlswrite or the xlsopen oct2xls xlsclose combo, depending on the complexity of the problem).

To ascii there are several ways, depending on how you want the data to look like.

save('-ascii','filename','matrix') has the inconvenient property (from my point of view, of course) that all elements have the same format. Hence, if there are floats everything (including zeros) will appear with exponential notation.

dlmwrite('filename', matrix, '\t') will yield a matrix where the formats of different entries is personalized (hence 0 instead of 0.000000). In the formal specifier '\t' is tab, if you prefer space or comma write ' ' or ','.

I hope this helps. 

reply via email to

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