[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #50109] run() command behaves differently with
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #50109] run() command behaves differently with functions and scripts |
Date: |
Sat, 21 Jan 2017 08:48:20 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0 |
URL:
<http://savannah.gnu.org/bugs/?50109>
Summary: run() command behaves differently with functions and
scripts
Project: GNU Octave
Submitted by: None
Submitted on: Sat 21 Jan 2017 08:48:19 AM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Makhno
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.0.0
Operating System: GNU/Linux
_______________________________________________________
Details:
This function:
----------
function func
addpath('/home/user/octave/test');
[folder,~,~]=fileparts(mfilename('fullpath'));
disp(folder)
end
------------
adds a path and displays the path the file func.m is in.
It works correctly when run from the command line. However, when invoked with
the run() command, it does neither and just exits. Worse, this seems to leave
Octave in some undefined state where running the function again from the
command line no longer works. This state is removed when 'clear all' is used.
I have had none of these problems with run() on Matlab.
The temporary fix appears to be to modify func.m so it is a script rather than
a function.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50109>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #50109] run() command behaves differently with functions and scripts,
anonymous <=