Finding coordinates of a number

조회 수: 1 (최근 30일)
Ryan
Ryan 2013년 3월 8일
How can i find the coordinates of a certain variable, which will be a number, in a matrix? For example: The matrix is A=[1 2 3; 4 5 6; 7 8 9]. The variable B=C, and C=1+1. Now if you follow that, B should equal 2. But I need to know how to write a program that finds the coordinates of B, which is 2 in the case, no matter what C is.
In simpler terms, I need to know how to find the variable B in matrix A.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 8일
편집: Azzi Abdelmalek 2013년 3월 8일
[ii,jj]=find(A==B)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cartesian Coordinate System Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by