Output rows of a matrix that meet a certain condition to a text file

3 visualizaciones (últimos 30 días)
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

Respuesta aceptada

madhan ravi
madhan ravi el 14 de Mzo. de 2019
dlmwrite('mytextfile.txt',m(m(:,5)>10,:),'delimiter',' ') %where m is your given matrix

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by