ezplot axis

27 views (last 30 days)
James Wright
James Wright on 4 Mar 2012
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

Accepted Answer

James Wright
James Wright on 5 Mar 2012
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

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!