find the index of non-zero elements of three dimensional matrix and rank the them according to the value

2 ビュー (過去 30 日間)
Chaoyang Jiang
Chaoyang Jiang 2018 年 6 月 11 日
コメント済み: Rik 2018 年 6 月 12 日
For a three dimentional matrix: A=randi(10,[10 10 5]), I want to find the index (x,y,z) of each non-zero element of A and then rank the all the non-zero elements according to the value.
However, when running the following code, it seems 'find' can only have three outputs. May I know how to achive this?
A=randi(10,[10 10 5]);


Rik 2018 年 6 月 11 日
You can use my FEX submission findND.
A=randi(10,[10 10 5]);
  2 件のコメント
Rik 2018 年 6 月 12 日
You're welcome, that's what I wrote that function for, glad to be of service


その他の回答 (0 件)


Community Treasure Hunt

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

Start Hunting!

Translated by