For example, if I want to read the middle value from magic(5), I can do so like this:
magic(5)
M = magic(5); value = M(3,3);
to get
It could be more simple if you make a new function:
function [ element ] = getElem( matrix, index1, index2 ) element = matrix(index1, index2); end
and then use it:
value = getElem(magic(5), 3, 3);