bugGNU Octave - Bugs: bug #33982, Use of tilde (~) operator to...

 
 

bug #33982: Use of tilde (~) operator to ignore outputs is not supported

Submitted by:  -Deleted Account- <gbhrt>
Submitted on:  Thu 11 Aug 2011 08:00:47 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: NoneAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.4.2Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 11 Aug 2011 09:23:17 PM UTC, comment #3:

Sorry to have frustrated you, but we're having distribution problems with Windows. We need help. Can you help? If Octave isn't working for you, perhaps you can help us improve it. Compiling on Windows is painful and complicated and few people want to help us do it.

However, some people have. Tatsuro Matsuoka has created some Octave 3.4.2 packages for Windows that may work for you, but are possibly still a little rough around the edges:

http://www.tatsuromatsuoka.com/octave/Eng/Win/

Also, bear in mind that Matlab compatibility is a moving target, since new versions of Matlab also frequently introduce new features, so we also need help catching up to it.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu 11 Aug 2011 08:10:07 PM UTC, comment #2:

If fixed, then update all OS versions. As youc an see I reported the windows version.

The usuage is hardly only limited to my example as you probably understand if you think for a while.

Thank you anyway, so far I havent seen the compaitbility you talk about, just about every sample I try there are differences from matlab.

-Deleted Account- <gbhrt>
Thu 11 Aug 2011 12:37:32 PM UTC, comment #1:

This feature was added in Octave 3.4.x. You marked that as the version in the bug report form, but your example shows that you are using Octave 3.2.4. I'm closing this report since the feature is already implemented in the current Octave release.

Also, there is rarely a need to ignore trailing output arguments unless your function does something different based on nargout. In the specific case you show, you might as well simply write

since the effect is the same.

OTOH, it is often more useful to write things like

since then the unneeded output is not stored in the scope of the function call even if it is computed by the function.

John W. Eaton <jwe>
Project Administrator
Thu 11 Aug 2011 08:00:47 AM UTC, original submission:

In matlab, inputs or outputs can be selectively ignored using the tilde ~ operator, Octave seem to think the use of ~ in these cases is a syntax error.

Example:

function [a, b] = example(a,b)
a = a +b;
b = a - b;
end

octave-3.2.4.exe:5> [a, ~] = example(1,2)
parse error:

syntax error

>>> [a, ~] = example(1,2)

^

Matlab documentation on the subject:
http://www.mathworks.com/help/techdoc/matlab_prog/bresuxt-1.html#br67dkp-1

-Deleted Account- <gbhrt>

 

(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 jordigh (Posted a comment)
  • -unavailable- added by jwe (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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 11 Aug 2011 12:37:32 PM UTCjweOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1