clearing specific data in matrix

1 次查看(过去 30 天)
Hi,
I have a question about clearing specific data in a matrix.
I have a matrix [1,14880] The data is between 1 and -20 I only need data that is above -5! Because below -5 are data errors.
How can i do this?
thanks in advance
Stijn

采纳的回答

Oleg Komarov
Oleg Komarov 2012-3-1
Use logical indexing :
idx = A <= -5;
A(idx) = NaN;
where A is your matrix and NaN stands for Not a Number.
I advice you to read the getting started guide. In your case the second chapter is fundamental. More specifically the logical indexing part is http://www.mathworks.co.uk/help/techdoc/learn_matlab/f2-14896.html#f2-15124.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by