bugGNU Octave - Bugs: bug #49886, ezplot: octave does not warn when...

 
 

bug #49886: ezplot: octave does not warn when function not vectorized

Submitter:  None
Submitted:  Mon 19 Dec 2016 01:12:49 PM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Need Info Assigned to:  None
Originator Name:  Alain Cochard Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 14 Sep 2023 03:28:15 PM UTC, comment #6: 

Bug is still present in Octave 8.3.0. 

Looking back through the comments, what is the preferred output for this type of function call?  Is it maintaining current output of a matrix-valued function, but with a warning?

Or is it to achieve compatibility by recognizing a function that cannot handle array-valued input, applying 'vectorize' to that function, and then outputting the vectorized plot along with a warning?

marking as need info.

Nicholas Jankowski <nrjank>
Group Member
Sat 10 Sep 2022 02:54:04 AM UTC, comment #5: 

FYI bug #42691 was closed in August 2021.
Should mean this bug is easier to fix now.


ezsurf(@(x,y) x+y+x^2, [-2 2])


Returns no errors or warnings, and a plot is created.
The two plots look different. Bottom one is without the dot.


Anonymous
Wed 04 Jan 2017 06:03:51 PM UTC, comment #4: 

This would be easy to fix if bug #42691 was first solved.  I've added #42691 as a dependency.

Rik <rik5>
Group administrator
Tue 20 Dec 2016 05:47:25 PM UTC, comment #3: 

Sorry, I meant "can matrix multiplication make sense in such context".

Anonymous
Tue 20 Dec 2016 05:42:10 PM UTC, comment #2: 

Can element-by-element multiplication make sense in such a context?

Can it make sense to have a plot which qualitatively depends on the
number of discretization points?

Anonymous
Tue 20 Dec 2016 04:59:26 PM UTC, comment #1: 

Alas, computers just aren't very smart--at least not until we get true artificial intelligence.  Octave is plotting the correct function, since it is up to the user to decide whether they want element-by-element multiplication or matrix multiplication.

I've changed the bug report title to be about the Matlab incompatibility and marking that as confirmed.

Rik <rik5>
Group administrator
Mon 19 Dec 2016 01:12:49 PM UTC, original submission:  

With the following (correct) syntax, the plot is OK, with both matlab
and octave:


ezsurf(@(x,y) x+y+x.^2, [-2 2])


With this incorrect syntax (the period is omitted)


ezsurf(@(x,y) x+y+x^2, [-2 2])


the plot is OK with matlab, with the warning message:


Warning: Function failed to evaluate on array inputs; vectorizing the
function may speed up its evaluation and avoid the need to loop over
array elements.
> In specgraph/private/ezplotfeval at 59
  In ezgraph3>ezeval at 623
  In ezgraph3>surfplot at 550
  In ezgraph3 at 49
  In ezsurf at 65


but it is totally wrong with octave (although not strikingly wrong at
first sight, i.e., not pure garbage), without any warning.

Also, if one provides a 3rd argument (number of points to be used) to
ezplot, the plot is different for different values of that argument.

I have tried versions 3.4.3, 3.8.2, 4.0.3, all with Fedora or CentOS
GNU/Linux distributions.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #53674:  ezsurf.png added by None (45KiB - image/png)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-09-14 nrjank StatusConfirmed Need Info
    2022-09-10 None Attached File- Added ezsurf.png, #53674
    2017-01-04 rik5 Dependencies- Depends on bugs #42691
    2016-12-20 rik5 CategoryPlotting Octave Function
        Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        Item GroupIncorrect Result Matlab Compatibility
        StatusNone Confirmed
        Release4.0.3 dev
        Summaryezplot: octave does not warn when function not vectorized -- and exhibits a wrong plot ezplot: octave does not warn when function not vectorized

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code