fscanf, sscanf not MATLAB compatible

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

fscanf, sscanf not MATLAB compatible

Eyal Doron
Hi,
   Just noticed that fscanf and sscanf are completely different from
the MATLAB commands of the same name:

Octave:

[A, B, C, ...] = fscanf (FILENAME or FILENUM, FORMAT)

Matlab 4.0:

[A,COUNT] = fscanf(FID,FORMAT,SIZE)

Additionally, the MATLAB version does not print errors or warnings if
not enough elements are read, it just sets COUNT to the number
successfully read. Much more useful, I think.

Eyal Doron

Reply | Threaded
Open this post in threaded view
|

fscanf, sscanf not MATLAB compatible

John W. Eaton-6
Eyal Doron <[hidden email]> wrote:

:    Just noticed that fscanf and sscanf are completely different from
: the MATLAB commands of the same name:

These commands were introduced in Matlab 4.x.  John Campbell and I
wrote Octave's implementation before I had ever seen or heard of
Matlab 4, so it was hard to be compatible.  :-)

I agree that they should work the same, at least optionally, so that
existing code won't break, and so that Octave can handle more Matlab
code without modification.  I am going to be working on that code soon
(for some other reasons), so maybe I'll be able to work on
compatibility too.

Thanks,

jwe