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

 
 

bug #39891: run command doesn't execute function

Submitted by:  Jan Rüegg <rggjan>
Submitted on:  Thu 29 Aug 2013 10:37:47 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.6.4Operating System: Any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

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>
Project 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 <ttl>
Project Member
Thu 29 Aug 2013 01:39:45 PM UTC, comment #2:

For vlfeat, there is a simple workaround.

Instead of doing

do

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

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 17 Oct 2013 10:20:14 PM UTCrik5StatusNeed Info=>Wont Fix
      Open/ClosedOpen=>Closed
    Thu 29 Aug 2013 01:33:07 PM UTCjordighStatusNone=>Need Info
    Thu 29 Aug 2013 10:37:47 AM UTCrggjanCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup