Hi guys, I'm having a bit of difficulty storing the output of the while loop in a vector. Here's my code. For some reason the 'thetak' vector it creates is [0,0,045] when I enter [45,45,45,45]
n=input('Number of Layers?: ');
i=0;
while i<n
thetak(n)=input('Enter Orientation Angle: ');
i=i+1;
end

 채택된 답변

Matt J
Matt J 2019년 4월 11일
편집: Matt J 2019년 4월 11일

0 개 추천

while i<n
i=i+1;
thetak(i)=input('Enter Orientation Angle: ');
end

댓글 수: 1

Briana Staheli
Briana Staheli 2019년 4월 11일
Wow that was way easier than i thought! thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2019년 4월 11일

댓글:

2019년 4월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by