matlab incompatibilities for fread
John W. Eaton
jwe at bevo.che.wisc.edu
Mon Apr 14 12:14:57 CDT 2008
On 14-Apr-2008, Kris Thielemans wrote:
| the manual states that incompatibilies with matlab are bugs, so... Here are
| 2 cases which do work in matlab, but not in Octave 3.0.0 (on Windows):
|
| data=fread(fid,3,'int16=>single');
| error: value on right hand side of assignment is undefined
| form that works:
| data=single(fread(fid,3,'int16'));
There is no single data type in Octave yet. The single function
actually returns a double value. Doing that is acceptable for many
programs that use single. It just uses more memory. Should we do the
same for fread? Or should we fix it so that it throws an error with a
more meaningful message?
| data=fread(fid,3,'int16','l');
| error: invalid conversion from string to real scalar
| error: octave_base_value::int_value (): wrong type argument `sq_string'
| error: fread: skip must be an integer
| error: evaluating assignment expression near line 26, column 5
| form that works:
| data=fread(fid,3,'int16',0,'l');
I don't see this feature explained in the Matlab does, but OK, what
about the following patch?
| Thanks for the excellent work!
|
| Kris Thielemans
| Hammersmith Imanet Ltd, part of GE Healthcare
| Cyclotron Building
| Hammersmith Hospital
| Du Cane Road
| London W12 ONN, United Kingdom
If you use Octave for your work, please consider contributing
something to the project. http://www.octave.org/funding.html
Thanks,
jwe
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080414/15c24ac8/attachment.ksh
More information about the Bug-octave
mailing list