[Scilab-users] Vectorization : how to proceed
    Paul Carrico 
    paul.carrico at free.fr
       
    Tue Nov 20 14:34:14 CET 2012
    
    
  
Dear All
 
In the above example, how can I proceed to perform the product (see function
fct_angles2) ?
 
Indeed, theta are 2 vectors, so no problem for the fct_angles . but in case
of product, it's naturally not work !!! what is the correct syntax in order
to use vectorization ?
 
Thanks 
 
Paul
 
######################################################
mode(0)
 
    function vect_fct=fct_angles(i, j)
        vect_fct = [cos(i)+sin(j) -sin(j) i j];
    endfunction
 
    function vect_fct2=fct_angles2(i, j)
        vect_fct = [cos(i)*sin(j) -sin(j) i j];
    endfunction
    
    
    B1 = zeros(130321,4);
    theta_vect = (0:360)'.*.ones(361,1);
    fi_vect = (ones(361,1)'.*.[0:360])';
    
    B1 = fct_angles(theta_vect([1:130321],1),fi_vect([1:130321],1));
    B2 = fct_angles2(theta_vect([1:130321],1),fi_vect([1:130321],1));
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20121120/fcc1521a/attachment.htm>
    
    
More information about the users
mailing list