ezplot: A same function with different plots!
古いコメントを表示
Hello all,
I am plotting a function in terms of a parameter (which is 'k' here).
When I give [-5,5] as the domain of k, the output is as follows:

As you see, there are solutions for k=[-3,-5]. But when I change the domain from [-50,50], then there is no solution for negative values of k's (the left-hand side of the diagram is empty):

As you see even for k=[-3,-5], nothing is plotted.
My code is as follows:
syms w
syms k
a=1
b=1
c=1
d=1
e=2
f=4
g=1
h=1
m=10
n=12
t=30
p=1
y=(-(w*(c*f+d*e))/(4*p*w-t*w+n*w+g*f))^(k+1)+(-(w*(a*f+h*e))/(4*p*w-t*w+m*w+g*f))^(k+1)-((b*w*e)/(2*p*w-t*w+m*w+n*w+g*f))^(k+1)+w^(k+1)
ezplot(y,[-5,5]) --------- Or -------> ezplot(y,[-50,50])
Would you please tell me the reason? How can I solve it?
回答 (1 件)
the cyclist
2016 年 6 月 4 日
編集済み: the cyclist
2016 年 6 月 4 日
1 投票
I think it will be helpful for you to read my answer -- and more importantly John D'Errico's comments -- on this similar question about ezplot.
The gist is that ezplot is finding contours, and can't always do it optimally over disparate ranges.
カテゴリ
ヘルプ センター および File Exchange で Code Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!