필터 지우기
필터 지우기

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 (최근 30일)
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개)

Star Strider
Star Strider 2023년 10월 26일
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.
.

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by