help-octave
[Top][All Lists]
Advanced

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

Re: Loading hex data


From: Doug Stewart
Subject: Re: Loading hex data
Date: Thu, 13 Sep 2012 09:28:09 -0400



On Thu, Sep 13, 2012 at 9:22 AM, Laurent Hoeltgen <address@hidden> wrote:
On 13/09/12 08:40, ionavideo wrote:
I'm learning Octave slowly.
In spite of days of searching on Google, I can't figure out why
octave won't take a simple file of hex data.

I tried making a data.txt, a simple one-column file, like this:
C2
27
4F
E

and in the main program wrote:
dummy = load('data.txt')

And no matter what I try, how I change things, I always get the error
"failed to read matrix from file."

I put quotes around each hex value -- doesn't matter. I don't understand how
to use fread,
and don't even know if that is what I am supposed to do.
I am very discouraged. Way behind in my online classes. There must be a
simple solution that I just
do not see.



--
View this message in context: http://octave.1599824.n4.nabble.com/Loading-hex-data-tp4644068.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


Hi,

load/save commands are usually used to read and write ".mat" files, which have a very specific format.. My suggestion would be to try the functions dlmread and dlmwrite. These functions read and write tabulated (e.g. matrix-like) data to standard text files. You can use the command "help dlmread" inside octave to learn more about the functions.

Regards,
Laurent

_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave

you could read it in as a string and use hex2dec


--
DAS

https://linuxcounter.net/user/206392.html

reply via email to

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