octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62682] ezplot() gets different results betwee


From: Glite
Subject: [Octave-bug-tracker] [bug #62682] ezplot() gets different results between inline function and anonymous function
Date: Thu, 30 Jun 2022 02:16:33 -0400 (EDT)

Follow-up Comment #13, bug #62682 (project octave):

You are right. I did a little more test and knew that ezplot() only follows
element-wise operations.
Here is the code:
>> ezplot(@(x,y)x*y-1)
# It draws nothing,too.

>> ezplot(@(x,y)x.*y-1)
# It draws hyperbola correctly.

And John declared that this won't be changed any more.
So here is the real problem:
It is the "warning: inline is obsolete; use anonymous functions instead" hint
that made me want to use anonymous function, but I have to change my formula
to get the correct figure.
The misleading hint is the root cause.

[comment #12 comment #12:]
> Matrix operations and element-wise operations involving scalars
"incidentally" have the same result. But in general, those operations aren't
the same.
> E.g.:
> 
> 
> >> A = [1 2; 3 4];
> >> A*A
> ans =
> 
>     7   10
>    15   22
> 
> >> A.*A
> ans =
> 
>     1    4
>     9   16
> 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62682>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]