Compact matlab matrix indexing notation
Posted
by AnnaR
on Stack Overflow
See other posts from Stack Overflow
or by AnnaR
Published on 2009-04-27T08:44:01Z
Indexed on
2010/05/01
19:57 UTC
Read the original article
Hit count: 257
I've got an nxk sized matrix, containing k numbers per row. I want to use these k number as indexes to k-dimensional matrix. Is there any compact way of doing so in matlab or must I use a for-loop?
This is what I want to do (in matlab-pseudo code), but in a more matlabish way.
for row=1:1:n
finalTable(row) = kDimensionalMatrix(indexmatrix(row, 1),...
indexmatrix(row, 2),...,indexmatrix(row, k))
end
© Stack Overflow or respective owner