[Scilab-users] Hypermatrix and user defined function

Rafael Guerra jrafaelbguerra at hotmail.com
Sat Nov 21 10:46:42 CET 2015


Hi,
 
Defining the left-hand side of your function has follows should help:
 
function [x, y]=mapToCylinder(a,M,r)
    .
endfunction
 
 
Regards,
Rafael
 
-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of petarf
Sent: Friday, November 20, 2015 4:03 PM
To: users at lists.scilab.org
Subject: [Scilab-users] Hypermatrix and user defined function
 
Hi,
 
I have part of code which calls user defined function:
 
for i=1:(m+1)
    alfac0(i)=atan(Mc(k/2,3,i),Mc(k/2,1,i));
    alfas0(i)=atan(Ms(k/2,3,i),Ms(k/2,1,i));
    alfap0(i)=atan(Mp(k/2,3,i),Mp(k/2,1,i));
 
    for j=1:k
 
        [xc,zc]=mapToCylinder(alfac0(i),Mc(j,1,i),r(i));
 
            end
 
end
 
With this code I only manage to write last value of xc and zc.
 
When I change xc and zc to:
for i=1:(m+1)
    alfac0(i)=atan(Mc(k/2,3,i),Mc(k/2,1,i));
    alfas0(i)=atan(Ms(k/2,3,i),Ms(k/2,1,i));
    alfap0(i)=atan(Mp(k/2,3,i),Mp(k/2,1,i));
 
    for j=1:k
 
        [MC(j,1,i),MC(j,3,i)]=mapToCylinder(alfac0(i),Mc(j,1,i),r(i));
 
     
    end
end
 
I get error: hmops: Invalid hypermatrix insertion.
 
Can anyone help?
 
Regards,
Petar
 
 
 
--
View this message in context:
<http://mailinglists.scilab.org/Hypermatrix-and-user-defined-function-tp4033111.
html>
http://mailinglists.scilab.org/Hypermatrix-and-user-defined-function-tp4033111.h
tml
Sent from the Scilab users - Mailing Lists Archives mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
 <mailto:users at lists.scilab.org> users at lists.scilab.org
 <http://lists.scilab.org/mailman/listinfo/users>
http://lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20151121/7f7cf71c/attachment.htm>


More information about the users mailing list