Info

この質問は閉じられています。 編集または回答するには再度開いてください。

For-loop in Matlab

2 ビュー (過去 30 日間)
Sergey Dukman
Sergey Dukman 2015 年 5 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hei!
I have the following for-loop:
for c=(1:10)
x=sind(c)
end
disp(x)
How can I get all values of x as a row vector? Matlab gives me values of x separately from each other. I want to combine them all together.
Sergey
  2 件のコメント
Radmilka
Radmilka 2015 年 5 月 16 日
for c=(1:10)
x(c)=sind(c);
end
disp(x)
Sergey Dukman
Sergey Dukman 2015 年 5 月 16 日
Hei!
Thank you!
best regards, Sergey Dukman

回答 (1 件)

Nobel Mondal
Nobel Mondal 2015 年 5 月 16 日
編集済み: Nobel Mondal 2015 年 5 月 16 日
You don't even need a for loop
c = 1:10;
x = sind(c);

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by