i need to plot many plots in a loop function.
1 view (last 30 days)
Show older comments
function data=coa08xxx_lines(n)
load xydata
for u=X(:,n)
for i=Y(:,n)
data= plot(u,i);
end
end
end
This code only plots the graph of n, but i want it to plot all the graps. for example if n=3, then i want the plot of 3, 2 and 1 to appear as subplots.
0 Comments
Accepted Answer
Azzi Abdelmalek
on 15 Nov 2013
Edited: Azzi Abdelmalek
on 15 Nov 2013
function data=coa08xxx_lines(n)
load xydata
ii=ceil(n/3);
jj=ceil(n/ii);
for k=1:n
subplot(ii,jj,k)
plot(u(:,k),y(:,k));
end
5 Comments
Azzi Abdelmalek
on 15 Nov 2013
function data=coa08xxx_lines(n)
data=load('xydata');
%If xydta contains x and y variables
y=data.Y;
u=data.X;
ii=ceil(n/3);
jj=ceil(n/ii);
for k=1:n
subplot(ii,jj,k)
plot(u(:,k),y(:,k));
end
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots 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!