Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

For-loop in Matlab

1 Ansicht (letzte 30 Tage)
Sergey Dukman
Sergey Dukman am 16 Mai 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentare
Radmilka
Radmilka am 16 Mai 2015
for c=(1:10)
x(c)=sind(c);
end
disp(x)
Sergey Dukman
Sergey Dukman am 16 Mai 2015
Hei!
Thank you!
best regards, Sergey Dukman

Antworten (1)

Nobel Mondal
Nobel Mondal am 16 Mai 2015
Bearbeitet: Nobel Mondal am 16 Mai 2015
You don't even need a for loop
c = 1:10;
x = sind(c);

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by