PDA

View Full Version : MATLab matrix question


Ethers0n
Apr27-05, 10:57 PM
Does anyone know how to pull the value of an element which has been calculated and placed in a matrix out of the matrix?

ie.

M = [a1, a2;
b1, b2];

c = a1*3;

?

I can't seem to find any information online...

Thanks.

faust9
Apr28-05, 12:06 AM
You reference elements like this:

Given any matrix

M=[a1,a2,a3,...,an;
.
.
.
m1,m2,m3,...,mn]

an element is accessed by referenceing its row and column position. So,
M(c,10) would return the element loacted in the third row, 10th column.