OOPS I forgot one important information.
In my mind I would like to extend the usual matrix product using
multidimensional matrix. Hence, given a (d,t,s) matrix ,V I want to
find two matrices W (d,r,s1) and H (r,t,s2) so that V = W*H
(eventually s=s1=s2) .In my problem I have s=2, i.e. every element of
the matrix V is a couple of elements.
I could obviously take the matrices V(:,:,1) , V(:,:,2) , etc, find
the corrispective Wi and Hi and then create the matrices W and H by
taking W(:,:,i)=Wi and H(:,:,i)=Hi. But it would mean to work in
parallel, while I introduced the second parameter in s to have a
better representation of V by W and H.
2009/11/5 Carlo de Falco <address@hidden
<mailto:address@hidden>>
On 5 Nov 2009, at 10:35, Alberto Frigerio wrote:
Hi everyone, I've some questions about multidimensional matrix.
*) It is possible to create (maybe using a list) a
multidimensional matrix
A, i.e. every element of A is not a number but a couple,
triplet, etc. of
numbers ?
you could use a multi-index matrix
A = rand (2,4,5);
A (:,2,4)
or a cell-array of matrices
for ii=1:4
for jj=1:5
A{ii,jj} = rand(3,1);
endfor
endfor
A {2,4}
*) How can I multiply two multidimensional matrices ?
in the second case you could use
cellfun (@(x,y) (x'*y), A, A, 'UniformOutput', false)
Thanks everybody,
Alberto
c.