Columns with at least one zero element
显示 更早的评论
Hi,
If I have a matrix with random dimension mxn , how can I detect a column which have at least one zero element?
Thank you
采纳的回答
更多回答(2 个)
Jos (10584)
2014-6-16
Let M be your mxm matrix:
tf = any(M==0,1) % true for columns with at least 1 zero
C = M(:,~tf) % columns with no zeros
类别
在 帮助中心 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!