Number of non-zero element
2 次查看(过去 30 天)
显示 更早的评论
I have n-number of arrays, I want to find the total non-zero element at a location. For example there are three arrays as following:
A = [2 0 0 2;
0 1 1 1;
1 3 0 0;
0 1 0 1];
B = [0 2 1 0;
3 1 1 1;
2 0 0 2;
0 1 0 1];
C = [0 2 3 0;
3 1 2 2;
4 0 2 1;
2 0 0 1]
How can I find the total number of non-zero elements in A, B, C for each location, e.g (1,1): 1, (1,2): 2, (1,3): 2 ? To get array D = [1 2 2 1; 2 3 3 3; ... ].
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Array Geometries and Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!