ezplot axis

26 ビュー (過去 30 日間)
James Wright
James Wright 2012 年 3 月 4 日
Hi,
I'm trying to use ezplot plot a symbolic function, and I will then use hold on to plot another 'picture' with it (though just using the plot function this time). The problem is that I want the axis swapped from what ezplot is chosing. Previously, I was using,
view([90 -90])
to swap the axis, however it seems to swap the next picture I plot too, which I didn't want swapped. To counter this I tried to set the axis from the start using,
ezplot(@(lam,epsy) L,[0 0.8 0.2 1]);
However this seems to cause some infinite loop, as instead of plotting almost instantly as it was previously doing, it causes my computer to make a lot of noise and takes a long time, and I always end up cancelling it before it finishes. If anyone can help I'd be very thankful,
James
(see full code below if you wish)
function StabilityPWVL(beta,n)
syms epsy lam x;
for k = 1:n
a = int(cos(x)*(cos(k*x)),x,0,2*pi);
b = int(cos(x)*(sin(k*x)),x,0,2*pi);
a = a/pi;
b = b/pi;
f = (beta/2)^2 + ((2*lam/k)-1)^2;
g = (a^2 + b^2)*(3*epsy/4)^2;
L = f - g;
figure(k)
ezplot(@(lam,epsy) L,[0 0.8 0.2 1]);
%h = ezplot(L,[0 0.8 0.2 1]);
%set(h,'color','k')
%view([90 -90])
end

採用された回答

James Wright
James Wright 2012 年 3 月 5 日
function [] = StabilityPWVL(n)
syms x
for k = 1:n
a = double(int(cos(x)*(cos(k*x)),x,0,2*pi)/pi);
b = double(int(cos(x)*(sin(k*x)),x,0,2*pi)/pi);
L = @(lam,epsy) ((2*lam/k)-1).^2 - (a^2 + b^2)*(3*epsy/4).^2;
figure(k)
ezplot(L,[0.2 1],[0 0.8])
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by