matlab compability of str2func

Ben Abbott bpabbott at mac.com
Fri Jun 12 04:10:22 CDT 2009


On Jun 12, 2009, at 4:55 AM, Jaroslav Hajek wrote:

> On Thu, Jun 11, 2009 at 2:51 PM, Norbert
> Froehlich<Norbert.Froehlich at mailbox.tu-dresden.de> wrote:
>>
>> Bug report for Octave 3.0.3 configured for i686-pc-msdosmsvc
>>
>> Description:
>> -----------
>>
>>  When I execute the following code in Matlab I get a correct function
>> handle, but not in octave.
>>
>>> f = str2func('>=');
>>
>> The error message in octave is:
>> error creating function handle "@>="
>>
>
> I don't see this documented in Matlab docs. Do you? If not, can you
> give an example of usage of such a feature (compared to using "ge")?
>


I tried it in Matlab 2009a, and it does work.

 >> my_ge = str2func ('>=')

my_ge =

     @ge

 >> my_gt = str2func ('>')

my_gt =

     @gt

 >> my_ge (1, 2)

ans =

      0

 >> my_ge (2, 1)

ans =

      1

Could this be an accident of the parser?

Ben





More information about the Bug-octave mailing list