[Top][All Lists]

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

how to split a char buffer to lines?

From: Ted Sariyski
Subject: how to split a char buffer to lines?
Date: Tue, 18 Jun 2002 09:05:27 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20020314 Netscape6/6.2.2


I am new with octave. I tried to port one script from matlab to octave but hit two problems. The first is how to split a long string to '\n'? I used to read the text file into a buffer:

#> fd = fopen('file.txt')
#> buffer=setstr(fread(fd, inf, 'char')');

and build an index array where '\n' is:

#> newlines_index = find(buffer == 10);

It returns an error:

#> error: invalid conversion from string to real matrix
#> error: type conversion failed for binary operator `=='

The second question is how to save a plot in a ps format. There is no 'print -dps ' in octave.

Thanks in advance,

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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