Saturday, 7 September 2013

matrix and array multiplication in matlab

matrix and array multiplication in matlab

i have a matrix using permutation function
>p=perms([1 i -1 -i])
>[a,b]=size(p)
and an array of random size (103 in this case)
>c=ones(103,1)
now want to multiply these two
>np=repmat(p,round(103/a),b)
>[g,h]=size(np)
>nc=repmat(c,round(a/g),h)
>prod=np.*nc.'
this gives error
>prod=np*nc.'
gives no error but answer is 0
how can i get value in terms of i and 1.

No comments:

Post a Comment