determine the coordinates with the 0's within a cell
3 次查看(过去 30 天)
显示 更早的评论
Hi! I have this cell. How can I determine the coordinates where the 0's are?
For example in 'matrix' I need to get a matrix with the coordinates (2,2) and (1,4):
matrix = importdata("matrix.mat");
out = [2,2; 1,4];
0 个评论
采纳的回答
Bruno Luong
2023-7-25
编辑:Bruno Luong
2023-7-25
Why storing scalars in cell and not in matrix? It is very inefficient.
load matrix
check_1
[i,j]=find(cellfun(@(x) isequal(x,0), check_1));
ij = [i,j]
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!