<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Calibri">Hi,<br>
<br>
I don't think there is a problem (on my 5.5.2 version) :</font><br>
<pre style="font-family:Monospaced;font-style:normal;font-size:16.0;"><span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(0,0,0);text-decoration:underline;">hm_display</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">m</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">n</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">l</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">a</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">rand</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">m</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">n</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">l</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(160,32,240);">for</span> <span style="color:rgb(0,0,0);">i</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(131,67,16);font-weight:bold;">m</span>
<span style="color:rgb(160,32,240);">for</span> <span style="color:rgb(0,0,0);">j</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(131,67,16);font-weight:bold;">n</span>
<span style="color:rgb(160,32,240);">for</span> <span style="color:rgb(0,0,0);">k</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(131,67,16);font-weight:bold;">l</span>
<span style="color:rgb(50,185,185);">mprintf</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">value of index [%d, %d, %d] = %f \n</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">i</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">j</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">k</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">a</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">j</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(0,0,0);">k</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(160,32,240);">end</span>
<span style="color:rgb(160,32,240);">end</span>
<span style="color:rgb(160,32,240);">end</span>
<span style="color:rgb(176,24,19);">endfunction</span></pre>
<tt>-->hm_display(1, 2, 1)</tt><tt><br>
</tt><tt>value of index [1, 1, 1] = 0.614538 </tt><tt><br>
</tt><tt>value of index [1, 2, 1] = 0.925896 </tt><br>
<br>
<tt>-->hm_display(2, 2, 2)</tt><tt><br>
</tt><tt>value of index [1, 1, 1] = 0.099382 </tt><tt><br>
</tt><tt>value of index [1, 1, 2] = 0.921327 </tt><tt><br>
</tt><tt>value of index [1, 2, 1] = 0.943183 </tt><tt><br>
</tt><tt>value of index [1, 2, 2] = 0.900707 </tt><tt><br>
</tt><tt>value of index [2, 1, 1] = 0.428058 </tt><tt><br>
</tt><tt>value of index [2, 1, 2] = 0.944902 </tt><tt><br>
</tt><tt>value of index [2, 2, 1] = 0.032740 </tt><tt><br>
</tt><tt>value of index [2, 2, 2] = 0.809432 </tt><br>
<br>
<div class="moz-cite-prefix">Le 22/06/2015 16:22, fujimoto2005 a
écrit :<br>
</div>
<blockquote cite="mid:1434982961621-4032488.post@n3.nabble.com"
type="cite">
<pre wrap="">Let x=zeros(m,n,l)
if m==1, x is generated as 2 dimension matrix, not 3 dim hyper-matrix.
In that case the specification of elemnt like x(i,j,k) fails.
But the value of m is unknown in advance.
Is there any code which I can deal with such a case in general way?
I don't like such as if m==1 then … else …, because the actual number of the
dimensions of hyper matrix i'm using is more than 4 and the nest of
if-cluase is troublesome.
Best ragards
--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/how-to-respond-the-shrinkage-of-hyper-matrix-tp4032488.html">http://mailinglists.scilab.org/how-to-respond-the-shrinkage-of-hyper-matrix-tp4032488.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Pierre-Aimé Agnel
R&D Projects Manager
Phone: +33.1.80.77.04.67
Mobile: +33.6.82.49.35.23
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.68
<a class="moz-txt-link-freetext" href="http://www.scilab-enterprises.com">http://www.scilab-enterprises.com</a> </pre>
</body>
</html>