how can i remove an element from a matrix
1 次查看(过去 30 天)
显示 更早的评论
hello community,
i have a matrix A=[0 0 0;0.7 1 0.7] i want to remove the element 1 A(2,2) help please
0 个评论
回答(1 个)
Ronny Landsverk
2019-4-14
If you want a representation of an empty element, use NaN (not a number).
A(2,2) = NaN;
1 个评论
Walter Roberson
2019-4-14
And if replacing the location with some set value such as NaN or -9999 is not appropriate, then you have the problem that rectangular arrays cannot have "holes" in them.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NaNs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!