Printing and Plotting after each loop
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Walter Roberson
il 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 Commenti
Walter Roberson
il 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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Other Formats in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!