Info

此问题已关闭。 请重新打开它进行编辑或回答。

For-loop in Matlab

1 次查看(过去 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