Problem with simple division like Y./X

6 Ansichten (letzte 30 Tage)
Raj Gupta
Raj Gupta am 26 Nov. 2012
Hi,
I am plotting X Vs Y and trying to display X vs Y./X
I am not getting a symmetric plot about the origin.
x=-1:0.001:1;
y=1.5*x+0.5;
plotyy(x,y,x,abs(y./x));
Kindly let me know the solution to the problem.
best regards

Akzeptierte Antwort

Vishal Rane
Vishal Rane am 26 Nov. 2012
This is the plot from the data u shared.
For plotyy(a1,b1,a2,b2)
b1 vs a1 is plotted on the left side while b2 vs a2 on the right
  1 Kommentar
Raj Gupta
Raj Gupta am 26 Nov. 2012
The curve diverges at x=0. However, the curve (y/x) is not symmetric about the point x=0. That is y/x - curve left and right of x=0 are not same (not symmetric). I was expecting that it should be symmetric about x=0. What is the problem? Why I am not getting a symmetric curve (y/x) about x=0?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Vishal Rane
Vishal Rane am 27 Nov. 2012
As per ur data x ranges from -1 to +1. For those x values y ranges from -1 to +2.
Since y values are not symmetric, u wont get a symmetric plot for y vs x. However the values of abs(y./x) are somewhat symmetric around 0, resulting in the symmetric plot for y vs abs(y./x).
  1 Kommentar
Raj Gupta
Raj Gupta am 28 Nov. 2012
Yes. I realized this. Thanks for the answer. f(x)=y/x=a+b/x which is not a symmetric function.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by