command in Matlab equivalent to "forall " in fortran
Mostrar comentarios más antiguos
Hi Is there any command in matlab that can simpilfy such loop:
for i=1:10 A(i)=i^2 end
as I know in fortran it can be written anr run very fast as FORALL(i=1,10) A(i)=i**2
I hope similar thing can be found in Matlab too.
Respuesta aceptada
Más respuestas (1)
Wayne King
el 24 de Mayo de 2012
A = 1:10;
A = A.^2;
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects 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!