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

 
 

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

Submitted by:  None
Submitted on:  Sat 21 Jan 2017 08:48:19 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: MakhnoOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.0
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 21 Jan 2017 10:34:20 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1