Filter löschen
Filter löschen

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 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

per isakson
per isakson am 29 Nov. 2012
1(mat)
is wrong. What's the intent?
  2 Kommentare
Emma
Emma am 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 am 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by