determine the coordinates with the 0's within a cell
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alberto Acri
le 25 Juil 2023
Modifié(e) : Bruno Luong
le 25 Juil 2023
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 commentaires
Réponse acceptée
Bruno Luong
le 25 Juil 2023
Modifié(e) : Bruno Luong
le 25 Juil 2023
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!