Very simple vectorization ?
Mostrar comentarios más antiguos
Good afternoon !
Is it possible to vectorize this short code ?
hello(1)=0;
for i=2:10
hello(i)=hello(i-1)+1;
end
Because the next one is effectively unappropriate :
hello=zeros(1,10);
i=2:1:10;
hello(i)=hello(i-1)+1;
Thank you for your answers !
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 6 de Jun. de 2012
hello = 0:9;
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!