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 次查看(过去 30 天)
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.

采纳的回答

per isakson
per isakson 2012-11-29
1(mat)
is wrong. What's the intent?
  2 个评论
Emma
Emma 2012-11-29
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 2012-11-29
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by