[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fri, 16 Nov 2012 17:58:16 -0500
On Nov 16, 2012, at 5:44 PM, Dimitri Maziuk wrote:
> On 11/16/2012 04:37 PM, Ben Abbott wrote:
>> The problem appears to be with the float.
>> [row, cnt, err] = sscanf (str, "%4d %1s %4s %8f")
>> row =
> Yes, but why is it not returning
> Anyway, the format string is read from the input file that I don't
> control (http://spin.niddk.nih.gov/NMRPipe/table/csObs.tab) so this is
> academic: if "8.3" doesn't work then sscanf() doesn't work as far as I'm
Using Matlab ...
str = ' 1 M HE 2.140';
[row, cnt, err] = sscanf (str, '%4d %1s %4s %8f');
[row, cnt, err] = sscanf (str, '%4d %1s %4s %8f')
So it appears the behavior is intended. No doubt someone familiar with the
sscanf() will educate us on what is happening.
Have you looked at textscan() or strread()? Their behavior seems to be closer
to what you're looking for.
- sscanf, Dimitri Maziuk, 2012/11/16