how to plot exel data by loop
Mostra commenti meno recenti
I have an Excel file that has 381 rows, and as shown in the figure in column F, I want the numbers 1 to be drawn together and the numbers 2 to be drawn together, ...

2 Commenti
Walter Roberson
il 26 Gen 2022
You have six numeric columns in addition to the grouping column. How do you want each segment to be drawn ?
a.s
il 26 Gen 2022
Risposta accettata
Più risposte (1)
Biraj Khanal
il 26 Gen 2022
I am still learning and would do this:
T=readtable('filename');
D1=[];
E1=[];
D2= []; E2=[];
for i = 1: height(T)
if T.F (i) == 1
D1(end+1) = T.D(i);
E1(end+1) = T.E(i);
elseif T.F(i) == 2
D2(end+1) = T.D(i);
E2(end+1) = T.E(i);
end
end
figure
plot(D1,E1)
hold on
plot (D2,E2)
I am sure there is a more efficient way to do it.
1 Commento
a.s
il 14 Feb 2022
Categorie
Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!