Output rows of a matrix that meet a certain condition to a text file
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
mzw
el 14 de Mzo. de 2019
Respondida: madhan ravi
el 14 de Mzo. de 2019
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 comentarios
Respuesta aceptada
madhan ravi
el 14 de Mzo. de 2019
dlmwrite('mytextfile.txt',m(m(:,5)>10,:),'delimiter',' ') %where m is your given matrix
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Operators and Elementary Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!