bugGNU Octave - Bugs: bug #48034, fplot errors when fn returns a row...

 
 

bug #48034: fplot errors when fn returns a row vector

Submitted by:  Muhali <muhali>
Submitted on:  Thu 26 May 2016 06:51:18 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.0.2Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 06 Jun 2016 10:56:33 PM UTC, comment #3:

This is kind of stupid. The function should respect the orientation of the data input and return output that is oriented in the same way. However, it isn't that hard to fix either. fplot now checks to see whether the number of columns matches the number of row inputs and if it is then it always transposes the output of the function evaluation. The changeset is on the development branch of Octave (http://hg.savannah.gnu.org/hgweb/octave/rev/1077f09a0cfd).

Fixed. Closing report.

Rik <rik5>
Project Administrator
Fri 27 May 2016 12:08:01 AM UTC, comment #2:

And we could possibly correct for simple errors like this, if fplot is expecting a column vector, but gets back a row vector of the right length, assume that it is correct and transpose it.

Mike Miller <mtmiller>
Project Administrator
Fri 27 May 2016 12:03:43 AM UTC, comment #1:

Thanks for the report. I can confirm the error you are seeing with your given function.

I modified it like so to make it work:

The important distinction being that the return value has the same size and shape as the input. Your example returned a row vector regardless of whether the input was a row, column, or matrix.

I think the error checking could be improved to make this clearer, as well as the docstring. Suggestions?

Mike Miller <mtmiller>
Project Administrator
Thu 26 May 2016 06:51:18 PM UTC, original submission:

with

the call

fplot(@fun, [-1 1])

results in

error: fplot: operator -: nonconformant arguments (op1 is 8x5, op2 is 8x8)
error: called from
fplot at line 160 column 9
error: evaluating argument list element number 1
error: called from
fplot at line 160 column 9
error: evaluating argument list element number 1
error: called from
fplot at line 160 column 9

The same call works in ML.

Muhali <muhali>

 

(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 mtmiller (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 06 Jun 2016 10:56:33 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 27 May 2016 12:08:41 AM UTCmtmillerSummaryfplot not working=>fplot errors when fn returns a row vector
    Fri 27 May 2016 12:03:43 AM UTCmtmillerCategoryNone=>Octave Function
      Item GroupNone=>Documentation
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1