How to collect non-integers from for loop in one matrix?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Aditya Palsule
el 1 de Jul. de 2015
Comentada: Jan
el 1 de Jul. de 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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 1 de Jul. de 2015
Editada: Azzi Abdelmalek
el 1 de Jul. de 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 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!