How to display elements of Matrix by entering coordinates

I want to display elements of a matrix by entering coordinates in the command window
Example:
1 0 0
0 1 0
0 0 1
if I enter disp(x(2,2));
I want to get 1

 Respuesta aceptada

You have to assign the matrix to ‘x’ first:
x = [1 0 0
0 1 0
0 0 1];
disp(x(2,2))
1

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 29 de Nov. de 2015

Respondida:

el 29 de Nov. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by