Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLab matrix question

  1. Apr 27, 2005 #1
    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.
     
  2. jcsd
  3. Apr 28, 2005 #2
    You reference elements like this:

    Given any matrix
    Code (Text):

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: MATLab matrix question
Loading...