MATLAB Pull Value from MATLab Matrix: Solve the Problem

  • Thread starter Thread starter Ethers0n
  • Start date Start date
  • Tags Tags
    Matlab Matrix
AI Thread Summary
To extract the value of a calculated element from a matrix in programming, one must reference the specific row and column of the matrix. For example, given a matrix M defined as M = [a1, a2; b1, b2], the value of an element can be accessed using its position, such as M(row, column). In this case, M(c, 10) would retrieve the element located at the third row and tenth column of the matrix. This method of referencing is standard across various programming languages, and detailed documentation may be required for specific implementations.
Ethers0n
Messages
27
Reaction score
0
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.
 
Physics news on Phys.org
You reference elements like this:

Given any matrix
Code:
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.
 

Similar threads

Replies
5
Views
3K
Replies
2
Views
2K
Replies
2
Views
2K
Replies
1
Views
2K
Replies
2
Views
1K
Replies
2
Views
2K
Replies
1
Views
3K
Back
Top