<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1646" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff size=2>Hi
Julien,</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff size=2>You
can use the matrix( ) function to format the data back as a matrix.
In your case:</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff size=2>B =
matrix (A(1, :, :), ,j, k);</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff size=2>will
do what you want I think.</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff size=2>Be
careful that you understand the data ordering that Scilab uses when storing
Hypermatrices, or you may get the result permuted in the wrong
way.</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff size=2>There
is also a useful function permute (), which allows you to "transpose"
hypermatrices. I'm not sure it's what you need, but check it out
anyway.</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2>HTH.</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2>Mike.</FONT></SPAN></DIV>
<DIV><SPAN class=391154918-19052010><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Julien Colmars
[mailto:julien.colmars@imelavi.fr]<BR><B>Sent:</B> 19 May 2010
18:42<BR><B>To:</B> users@lists.scilab.org<BR><B>Subject:</B> [scilab-Users]
SciLab question dealing with linear algebra / tensor
multiplication.<BR><BR></FONT></DIV>Hi,<BR><BR>I've a SciLab problem dealing
with<B> linear algebra / tensor multiplication.</B><BR><BR>Let's say I have
<B>a matrix A wich size is i * j * k</B> ( is it called a matrix in SciLab ? a
3rd order tensor ? a table ?...) <BR><BR>SciLab knows that <B>A(:,:,1) is a
matrix</B>, and SciLab is able to multiply it with another matrix...<BR>But it
is <B>not the case of A(1,:,:)</B> for example.... which seems to be a table
of 2 1x2 vectors. [at least in SciLab 4.2.1]<BR><BR>I'm looking for an elegant
solution to avoid many loops... my calculation is becoming too slow
:<BR><BR><B>So these are my questions :</B><BR>
<UL>
<LI>why it is not implemented in SciLab ? (sorry for this naive question)<B>
Is there a specific reason not to authorize to build a matrix from table
values ?</B><BR>
<LI><B>How could it be done</B> (call to external C/Fortran routine or
specific linear algebra libraries) ? <BR>
<LI><B>Is it possible to simply make a permutation of two subscript</B><SPAN
class=POS2> : for example from A(i,j,k) I want to get B = A(k,j,i) ? This
way I could make my basic multiplications...</SPAN> </LI></UL>I hope it is
clear enough...<BR>Thank you in advance for your help.<BR><BR><BR><BR
clear=all><B>Julien Colmars</B><BR><BR>PhD student, <BR>Équipe Mécanique de
l'Arbre et du Bois<BR>Laboratoire de Mécanique et Génie Civil<BR>Adresse :
LMGC - UMR5508 <BR>
Université Montpellier 2<BR>
CC 048 Place Eugène Bataillon<BR>
34090 Montpellier, France<BR>Tel. :
+33 (0)4 67 14 96 42<BR>Fax. : +33
(0)4 67 14 47 92<BR></BLOCKQUOTE></BODY></HTML>