[Scilab-users] Hypermatrix and user defined function
Samuel Gougeon
sgougeon at free.fr
Sat Nov 21 17:22:53 CET 2015
Hello,
Le 20/11/2015 17:02, petarf a écrit :
> .../...
>
> [MC(j,1,i),MC(j,3,i)]=mapToCylinder(alfac0(i),Mc(j,1,i),r(i));
If MC is not initialized as an hypermatrix before the first assignment
for i=1, the first use MC(j,1,1),MC(j,3,1) initializes it as a common
2D matrix (with Scilab 5), since dimensions>2 that are singletons are
ignored (this is no longer the case in Scilab 6, since a very recent
modification). Then, next assignments with i>1 try to cast MC into an
hypermat. I don't think that Scilab 5 can do that in this way.
Scilab 6 should do it, since hypermatrices are no longer encoded as
mlists but are natively encoded as matrices are.
So: with SCilab 5, just initialize MC as an hypermat with the right
final sizes before using it, and your code should work.
Or you may start to use Scilab 6.
HTH
Samuel Gougeon
More information about the users
mailing list