how to call on a specific value in matlab

In Matlab, you can call on a specific value in a matrix or array using indexing. Here's an example:

Suppose you have a matrix A:

main.m
A = [1 2 3; 4 5 6; 7 8 9];
27 chars
2 lines

To call on the value in the second row and third column (which is 6), use indexing like this:

main.m
A(2,3)
7 chars
2 lines

The output should be 6.

Note that indexing in Matlab starts at 1, not 0.

gistlibby LogSnag