command in Matlab equivalent to "forall " in fortran
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (1)
Wayne King
il 24 Mag 2012
A = 1:10;
A = A.^2;
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!