octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #37520] run() does not execute functions


From: anonymous
Subject: [Octave-bug-tracker] [bug #37520] run() does not execute functions
Date: Mon, 08 Oct 2012 14:34:10 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1

Follow-up Comment #3, bug #37520 (project octave):

Although the Matlab documentation says run() is there to document scripts, it
does actually run functions just fine as well, and it does not interpret them
as scripts or anything.

In fact, the function below works in Matlab and Octave, and it reproduces the
correct behavior in this context. So, I do not think it would be hard or
disadvantageous to be Matlab compatible in this case.

I can't really comment on the links that you are referring to, since they seem
to deal with different issues.

Regards,
Clemens
---

function runit(s)

[p,s,ext]=fileparts(s);
cwd = pwd();
cd(p);
try
        eval([s ';']);
catch e
        cd(cwd)
        rethrow(e);
end

cd(cwd);

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37520>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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