Effacer les filtres
Effacer les filtres

When I try to run the following line of code, I get the error message "Error: Unbalanced or unexpected parenthesis or bracket." Although I understand the content of the error message, I cannot determine what is wrong with my syntax.

1 vue (au cours des 30 derniers jours)
When I try to run the following line of code, I get the error message "Error: Unbalanced or unexpected parenthesis or bracket." Although I understand the content of the error message, I cannot determine what is wrong with my syntax.
[row,col]=find(mat==1(mat));
Thank you.

Réponse acceptée

per isakson
per isakson le 29 Nov 2012
1(mat)
is wrong. What's the intent?
  2 commentaires
Emma
Emma le 29 Nov 2012
I would like to find the row/column locations of all values in a 2400x2400x46 matrix that are equal to 1 (ideally in the output format of a matrix that has the rows in one column and the corresponding columns in a second column).
Image Analyst
Image Analyst le 29 Nov 2012
It's the mat'th element of one. ;-) Maybe try this:
[row, col] = find(mat == 1);
Just trying to give you something to try in advance. Tell us if that did work (and mark this as "Answered") or else tell us what you intended.

Connectez-vous pour commenter.

Plus de réponses (0)

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!

Translated by