Thursday, 15 September 2011

Delete Specific Rows in Matlab -


I have a large 2x2 matrix in which the date and temperature are included. I have NaN's cluster and incorrect data. Use the Find to obtain the index. These indexed are stored in other variables. How do I remove the rows related to the index (date and value)? Thank you.

large enough 2x2 matrix less or no understanding.

This is part of the catalog documentation

You can remove rows and columns from the matrix by specifying the empty array [] of those rows or columns. Start with

  A = magic (4) a = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1   

Then delete the second column of

  A (:, 2) = []   

from the matrix A to

  A = 16 3 13 5 10 8 9 6 12 4 15 1   

You can also delete several rows / columns together:

  A ([1 3], :) = [] A = 5 10 8 4 15 1    

No comments:

Post a Comment