finding NON in matrix
1 次查看(过去 30 天)
显示 更早的评论
Hi all In the matrix A which is 1*N matrix, I want to recognize if there is any element equal to NON in it,I replace it by zero.How can I do that?
采纳的回答
Laura Proctor
2011-5-24
I'm going to assume that you mean NaN. You can use the ISNAN function to find and replace the NaNs in your code. Here's an example:
A = randn(1,100);
A([2,10,23,47,88]) = NaN;
A(isnan(A)) = 0;
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!