i have to read an exel file which has iterations and cl/cd/cm and make a loop for plotting subplots for cl/cd/cm vs iteration which has different angle of attacks.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
this is the code i am currently using.
dataset=readtable('output2''.xlsx');
dataset.Properties.VariableNames(1) = "iteration1";
dataset.Properties.VariableNames(2) = "cl";
dataset.Properties.VariableNames(3) = "iteration2";
dataset.Properties.VariableNames(4) = "cd";
dataset.Properties.VariableNames(5) = "iteration3";
dataset.Properties.VariableNames(6) = "cm";
y1=dataset.iteration1;
y2=dataset.cl;
y3=dataset.cd;
y4=dataset.cm;
subplot(3,1,1);
plot(y1,y2,'r--');
subplot(3,1,2);
plot(y1,y3,'b--');
subplot(3,1,3);
plot(y1,y4,'g--');
1 Kommentar
Antworten (1)
Star Strider
am 26 Okt. 2023
If you need to do those plots in a loop, and assuming that the table variable names are (in order): iteration1, cl, iteration2, cd, iteration3, cm, set the loop up as:
figure
for k = 1:2:6
subplot(3,1,ceil(k/2))
plot(dataset{:,k}, dataset{:,k+1})
end
Add other plot enhaancements as necessary.
.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!