Replacing whole row with NaN's if first value is equal to 13 or 15.
1 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Voss
2022-6-19
Do you mean the value of the first column is equal to 13 or 15?
A = randi(20,10,5)
idx = A(:,1) == 13 | A(:,1) == 15;
A(idx,:) = NaN
Or do you mean replace the whole column if the value of the first row is 13 or 15?
A = randi(20,10,5)
idx = A(1,:) == 13 | A(1,:) == 15;
A(:,idx) = NaN
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NaNs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!