how to store values from loop in an array?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
kitty varghese
le 8 Août 2017
Modifié(e) : kitty varghese
le 8 Août 2017
v=[1 2 3;4 5 6;7 8 9]
l2=zeros(3,1)
for i=1:3
l2=norm(v((i),:),2)
end
i want to store store l2 values in an array.
1 commentaire
Réponse acceptée
KSSV
le 8 Août 2017
v=[1 2 3;4 5 6;7 8 9] ;
l2=zeros(3,1) ;
for i=1:3
l2(i) = norm(v((i),:),2) ;
end
Read about MATLAB matrix indexing.....
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!