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 についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by