Creating multiple plots with for loop
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jason Yee
le 6 Juil 2022
Réponse apportée : Yatharth
le 6 Juil 2022
I wish to create a program that comb through a file with data and create several plots. I have a prototype below but it does not give me all of the plots I need. Thank you.
T = V22050100Emat;
A = table2array(T);
x = A(1:52, 4);
y = A(1:52, 5);
plot(x,y,'ro')
title('Data points')
figure;
ph = plot(0,0,'ro');
%ax = gca;
%set(ax,'XLim');
%set(ax,'YLim');
for i = 1:10
set(ph,'XData',A(52+50*i:102+50*i, 4));
set(ph,'YData',A(52+50*i:102+50*i, 5));
drawnow;
end
0 commentaires
Réponse acceptée
Yatharth
le 6 Juil 2022
Hey, if you want to plot and Display Multiple Axes in a Figure you can do so by
tiledlayout(10,1)
for i = 1:10
x= A(52+50*i:102+50*i, 4);
y1 = A(52+50*i:102+50*i, 5);
nexttile
plot(x,y1)
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Performance dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!