필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

is it possible to do what is in the code below?

조회 수: 1 (최근 30일)
Cauli Vilela Ferreira
Cauli Vilela Ferreira 2020년 7월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
is it possible to do what is in the code below? marked on '!!'
for k = 1 : numel(VetorN)
DiscSt.N(k) = VetorN(k);
z = 2;
VetorA = ( 0 + ( z *( 0 : in ) ) );
WingSt.AoA = deg2rad( 5 );
if k == length(VetorN)
for j = 1 : numel( VetorA )
DiscSt.N = N;
WingSt.AoA(j) = deg2rad( VetorA(j) ); % input angle of attack
end !!%% this end for 'if'!!
WingSt.CL = WingSt.AoA + DiscSt.N;
C = [ 1 1 WingSt.AoA 1 1];
if k == length(VetorN)
break
end
end !!% !!this end for 'for'!!
CL = WingSt.CL;
end
CL1 = WingSt.CL
C
  댓글 수: 5
Cauli Vilela Ferreira
Cauli Vilela Ferreira 2020년 7월 3일
What if I create two scripts one for each 'for loop' and want to call the variable from one script to the other. And so make a plot (CL, CL1).
1 (this i will make a plot)
for k = 1 : numel(VetorN)
DiscSt.N(k) = VetorN(k);
WingSt.AoA = deg2rad( 5 );
WingSt.CL = WingSt.AoA + DiscSt.N;
CL = WingSt.CL;
end
plot(CL,CL1)
2
z = 2;
VetorA = ( 0 + ( z *( 0 : in ) ) );
for j = 1 : numel( VetorA )
DiscSt.N = N;
WingSt.AoA(j) = deg2rad( VetorA(j) ); % input angle of attack
WingSt.CL = WingSt.AoA + DiscSt.N;
C = [ 1 1 WingSt.AoA 1 1];
CL1 = WingSt.CL
end
C
Image Analyst
Image Analyst 2020년 7월 3일
Try typing control-a (to select all text) then control-i (to fix the indenting). That will alert you to missing end statements and you can see whether the loops and if blocks look correct.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by