Finding coordinates of a number

1 visualización (últimos 30 días)
Ryan
Ryan el 8 de Mzo. de 2013
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.

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 8 de Mzo. de 2013
Editada: Azzi Abdelmalek el 8 de Mzo. de 2013
[ii,jj]=find(A==B)

Más respuestas (0)

Categorías

Más información sobre Cartesian Coordinate System Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by