How can I display these plots on two different lines?

1 view (last 30 days)
I'm not sure how to get these two plots on two seperate lines together. ( I want the 5 sin(ax) plots positioned above the 5 a*sin(x) plots)
x=linspace(-2*pi,2*pi,100);
y=sin(a*x);
z=a*sin(x);
a_range = (1:5);
M=zeros(num_a_values,length(x));
M=[];k=1;
C=zeros(num_a_values,length(x));
C=[];b=1;
for a=a_range
y=sin(a*x);
M(a,:)=y;
end
for k=1:5
hold on
plot(x, M(k,:))
hold off
end
for k=1:5
subplot(1,5,k)
plot(x, M(k,:))
end
for a=a_range
z=a*sin(x);
C(a,:)=z;
end
for b=1:5
hold on
plot(x, C(b,:))
hold off
end
for b=1:5
subplot(1,5,b)
plot(x, C(b,:))
end
  1 Comment
dpb
dpb on 27 Feb 2021
" I want the 5 sin(ax) plots positioned above the 5 a*sin(x) plots)"
Not sure just what that means, precisely. Can you make a sketch of a couple of what you envision result should look like for us?

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!