Output rows of a matrix that meet a certain condition to a text file
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a matrix that looks like the following. I want to output all the rows to a text file that have a 5th column value greater than 10.
10 5 4 6 10
4 8 10 4 11
1 8 24 7 9
4 8 22 11 7
5 1 18 2 14
So the text file would look like
4 8 10 4 11
5 1 18 2 14
0 Commenti
Risposta accettata
madhan ravi
il 14 Mar 2019
dlmwrite('mytextfile.txt',m(m(:,5)>10,:),'delimiter',' ') %where m is your given matrix
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Operators and Elementary Operations 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!