Creating multiple plots with for loop

4 visualizaciones (últimos 30 días)
Jason Yee
Jason Yee el 6 de Jul. de 2022
Respondida: Yatharth el 6 de Jul. de 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

Respuesta aceptada

Yatharth
Yatharth el 6 de Jul. de 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
You can refer to the documentation for various configuration

Más respuestas (0)

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by