Hallo dear forum,
I just don't find a problem for my actually simple problem.
I have the following matrix:
A = magic(4)
I now want the values of the matrix in position:
value1 = A(1,1)value2 = A(2,2)value3 = A(3,1)
My actual matrix indexes are in a vector in this form:
index = [1 1;2 2;3 1];
My solution (that is obviously wrong) would be:
solution = A(index)
Is there an easy way without using loops?
Thank you so much!