OK, you are right, I explained the problem in a terrible way. Let's
restart with "usual" matrices.
I have a matrix V (sive(V)=[d,t]) of positive elements and, using an
iterative algorithm, I found its non negative matrix factorization, V
= W*H, where size(W)= [d,r] and size(H)=[r,t]. What I want now to do
is improving the same thing for a multidimensional matrix.
Hence, if size(V)=[d,t,s] I wanna find two matrices W and H such as V
= W*H . My first idea was to consider V(:,:,1) , to find W1 and H1
such as V(:,:,1)=W1*H1 with my algorithm, and then to repeat it for
V(:,:,2) , V(:,:,3) , etc . At the end I will consider W={W1,W2,W3,
etc.} and H={H1,H2,H3, etc.} .
But in this way I will consider V(:,:,1) , V(:,:,2) ,... as completely
indipendent matrices, but it is not true. What I would like to do is
to find the matrices W and H using, at the same time, all the
V(:,:,i)'s. I don't know if I'm talking about something possible or
not, it is just an idea I had yesterday looking at my algorithm ...
Hope I explained the problem in a better way!!!!!
2009/11/5 David Grundberg <address@hidden <mailto:address@hidden>>
I have absolutely no idea what you are trying to say. Your idea of
"multiplication" is not something I recognize as multiplication.
Also, if you want to find W and H given V, it is misleading to say
that you are "extending the usual matrix product".
Alberto Frigerio wrote:
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>
<mailto: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.