Printing and Plotting after each loop
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a for loop where the structure is like this
A=[1 3 4;3 5 6]
U=[]
for i=1:10
...
U=A
end
how would I print U matirx after each loop on the text file beacause when I am doing that only the matirx in the 10th iteration loop prints and how would I be able to plot all those iterations in one figure using point clouds?
3 commentaires
Réponse acceptée
Walter Roberson
le 4 Mar 2021
A=[1 3 4;3 5 6]
U=[]
for i=1:10
A = A * 2;
U=A;
dlmwrite('U.txt', U, '-append')
end
!cat U.txt
3 commentaires
Walter Roberson
le 4 Mar 2021
A=[1 3 4;3 5 6]
U=[]
for i=1:10
A = A * 2;
U=A;
dlmwrite('U.txt', U, '-append')
dlmwrite('U.txt', ' ', '-append')
end
!cat U.txt
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Other Formats 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!