How to collect non-integers from for loop in one matrix?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aditya Palsule
am 1 Jul. 2015
Kommentiert: Jan
am 1 Jul. 2015
eg: for k=1:.5:10 y(k)=[k] end
this wont work i need output as y=1 1.5 2 2.5 and so on.
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 1 Jul. 2015
Bearbeitet: Azzi Abdelmalek
am 1 Jul. 2015
ii=0;
for k=1:.5:10
ii=ii+1
y(ii)=k
end
or
k=1:.5:10
for ii=1:numel(k)
y(ii)=k(ii)
end
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!