if m = 5, then
Uns = ones(1,m) means 1x5 matrix(vector) of 1: [1 1 1 1 1]
Xijm(:,Uns) is called Tony's trick where you actually replicate the
Xijm (vector i guess) 5 times (according to the Uns.) e.g.
http://xtargets.com/snippets/posts/show/55
Matlab introduced repmat() function that does the job "
Gabriel J.L. Beckers wrote:
> I found a matlab script that I want to translate into numpy, but have
> difficulties with understanding indexing in matlab. I haven't used
> matlab very much and I was hoping that someone could help with the
> following:
>
> It says:
>
> Uns = ones(1,m);
>
I found a matlab script that I want to translate into numpy, but have
difficulties with understanding indexing in matlab. I haven't used
matlab very much and I was hoping that someone could help with the
following:
It says:
Uns = ones(1,m);
... and then later
Xijm(:,Uns)