octave-maintainers
[Top][All Lists]
Advanced

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

Re: Compatibility problem with strread and \n delimiter


From: Søren Hauberg
Subject: Re: Compatibility problem with strread and \n delimiter
Date: Sat, 15 Oct 2011 12:45:53 +0200

lør, 15 10 2011 kl. 11:01 +0100, skrev Michael Goffioul:
> Hi,
> 
> While testing mirone with QtHandles, I found an issue with strread and
> \n delimiter,
> when the delimiter is double-quoted or single-quoted. It boils down to
> the following:
> 
> octave-qt.exe:5> strread(sprintf('1\n2\n3'), '%d', 'delimiter', '\n')
> ans = 123
> octave-qt.exe:6> strread(sprintf('1\n2\n3'), '%d', 'delimiter', "\n")
> ans =
> 
>   1
>   2
>   3
> 
> As ML doesn't have double-quoted strings, only the first form is valid, but 
> from
> what I can see from mirone code, it looks like in ML, the first form
> actually gives
> the second result. Can anybody confirm? Do we want to change this in octave?

In Matlab I see

>> strread(sprintf('1\n2\n3'), '%d', 'delimiter', '\n')

ans =

     1
     2
     3

I think the ML behaviour is fairly sensible, so I would suggest making
Octave compatible here.

Søren



reply via email to

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