MATLAB: Reading floating point numbers and strings from a file

Posted by xsound on Stack Overflow See other posts from Stack Overflow or by xsound
Published on 2010-04-11T04:01:37Z Indexed on 2010/04/11 4:03 UTC
Read the original article Hit count: 319

Filed under:
|
|

I am using the following functions for writing and reading 4098 floating point numbers in MATLAB:

Writing:

fid = fopen(completepath, 'w');

fprintf(fid, '%1.30f\r\n', y)

Reading:

data = textread(completepath, '%f', 4098);

where y contains 4098 numbers. I now want to write and read 3 strings at the end of this data. How do I read two different datatypes? Please help me. Thanks in advance.

© Stack Overflow or respective owner

Related posts about matlab

Related posts about algorithm