bugGNU Octave - Bugs: bug #39891, run command doesn't execute...

 
 

bug #39891: run command doesn't execute function

Submitter:  Jan Rüegg <rggjan>
Submitted:  Thu 29 Aug 2013 10:37:47 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.6.4 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 17 Oct 2013 10:20:14 PM UTC, comment #5: 

It's more important to keep Octave's ability to define functions in scripts so I'm marking this bug as "Won't Fix".

Rik <rik5>
Group administrator
Sat 14 Sep 2013 04:15:36 PM UTC, comment #4: 

When the function has parameters, I think matlab crashes when one of the function values is accessed...

Jan Rüegg <rggjan>
Thu 29 Aug 2013 04:43:24 PM UTC, comment #3: 

IMHO defining functions in script files is more helpful than running a function with "run".
Btw: What happens if the function has parameters?

Torsten Lilge <ttl>
Group Member
Thu 29 Aug 2013 01:39:45 PM UTC, comment #2: 

For vlfeat, there is a simple workaround.

Instead of doing


run VLFEATROOT/toolbox/vl_setup


do


oldir = pwd
cd VLFEATROOT/toolbox
vl_setup
cd(oldir)


You could make this a wrapper into the actual vl_setup script.

You will note that you're abusing an undocumented Matlab feature here. The Matlab docs clearly state that "run" is for script files, not for function files:

http://www.mathworks.com/help/matlab/ref/run.html

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Thu 29 Aug 2013 01:32:52 PM UTC, comment #1: 

This is not a bug, or if it is, we'll have to completely abandon defining functions in script files, a feature that Matlab lacks.

How important is this? Should we abandon an Octave feature in order to make this work?

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Thu 29 Aug 2013 10:37:47 AM UTC, original submission:  

These two lines are in a file "test.m"

function test()
disp('text')

executing

run('test.m')

in matlab shows "text" on the command line. Doing the same in octave leads to no result. So matlab seems to parse AND execute the function, while octave only parses the function...

For example, the vl_setup script of the vl_feat toolbox (http://www.vlfeat.org/) doesn't work in octave becauso of that...

Jan Rüegg <rggjan>

 

(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)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by rggjan (Submitted the item)
  • -email is unavailable- added by rggjan
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-17 rik5 StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
    2013-08-29 jordigh StatusNone Need Info
    2013-08-29 rggjan Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code