non zero elements in matrix

3 次查看(过去 30 天)
Hello,
I have a matrix 50*50 and every single elements has a value of either '0' or '1' . How can I determine all locations of all non zero elements. It would be nice if I could store the location in an array or something easy to read and understand.
Thank you

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020-4-3
[r,c]=find(mat~=0)

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by