bugGNU Octave - Bugs: bug #50109, run() command behaves differently...

 
 

bug #50109: run() command behaves differently with functions and scripts

Submitter:  None
Submitted:  Sat 21 Jan 2017 08:48:19 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Makhno Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 21 Jan 2017 10:34:20 PM UTC, comment #1: 

The version 4.0.0 is no longer supported.  This issue has been fixed in the stable version of Octave which is currently 4.2.0.  Try upgrading.  You can re-post to this report if that doesn't fix it.

Rik <rik5>
Group administrator
Sat 21 Jan 2017 08:48:19 AM UTC, original submission:  

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.



Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-01-21 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code