octave-maintainers
[Top][All Lists]
Advanced

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

evaluation order in matlab/octave


From: Levente Torok
Subject: evaluation order in matlab/octave
Date: Sat, 27 Sep 2008 17:59:34 +0200
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

Hi!

The following expression runs differently on octave than on matlab:

function z = f( par ) 
    if ( nargin==0 | isempty(par) )
        z=3;
    end
end

Calling
        f;
results in differences.

In matlab if the first part of the if statment is true, the second term is not 
evaluated hence it
runs fine.
In octave it raieses and error that par is not defined.
Is there a way to overcome this or it would cause too much work.

Lev

-- 
Blogger of http://fapuma.blogspot.com


reply via email to

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