[Top][All Lists]

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

Re: MATLAB / Octave differences [Was: Function ending.]

From: Shai Ayal
Subject: Re: MATLAB / Octave differences [Was: Function ending.]
Date: Thu, 20 Jul 2006 06:57:47 +0300
User-agent: Thunderbird (Windows/20060516)

John Darrington wrote:
Thanks to all those who replied to me.  The problem turned out to be
unrelated to this issue.
It seems that the behaviour of the "which" command is different.  In
the case where "name" is undefined, which("name") returns "undefined"
in Octave, but in MATLAB it returns an empty result.

The code I was trying to run relied upon the MATLAB behaviour.

Is there a flag which will change this?


I don't know about a flag, but as a workaround you could check the output of which for "undefined" as well, e.g. (untested code)

tt = which(name);
exist_flag = 1;
 exist_flag = 0;

"exist_flag" will now tell you if name is defined.
also, you might have a look at the "exist" command


On Wed, Jul 19, 2006 at 09:33:53AM +0800, John Darrington wrote:
I've been trying to get some MATLAB code to work with Octave.

The most obvious difference between the two programs is that MATLAB
expects functions to be closed with "end" whereas Octave expects
"endfunction", even when running with --traditional.

Looking at the FAQ,
it cites three categories of differences:

   1. Irrelevant.
   2. Known differences, perhaps configurable with a user preference variable.
3. Unknown differences.
Clearly this doesn't belong to the #1 and it's not mentioned anywhere in
the documentation, so despite this difference being extremely obvious,
I have to conclude that it's an "Unknown difference".

Does anyone have any ideas on how to overcome this problem?

To whom should I report this Unknown Difference?


Help-octave mailing list

reply via email to

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