[Scilab-users] applying a function to each element

Frieder Nikolaisen Frieder.Nikolaisen at student.hs-rm.de
Wed May 10 13:48:52 CEST 2017


 

Hello Samuel, 

thanks a lot. It works fine. 

Best regards
Frieder


Am 2017-05-10 13:33, schrieb sgougeon at free.fr: 

> Hello Frieder,
> 
>
max(A,B) does it:
> --> max(A,B)
> ans =
> 3.
> 3.
> 2.
> 
> Samuel
> 
>
----- Mail original -----
> 
> Hello, 
> 
> I have to matrices: A = [ 1
; 2 ; 2 ] B = [ 3 ; 3 ; 1 ] 
> 
> I looking for get matric with having
only the larger Elemtns: 
> 
> C = [ 3 ; 3 ; 2 ] 
> Is there function to
make to apply functions to eacth element. 
> 
> C = [ if A .> B then A
else B] elemtwise. 
> 
> A for loop is to slow. 
> 
> Thanks a lot. 
>

> Cheers 
> Frieder 
>
_______________________________________________
> users mailing list
>
users at lists.scilab.org
>
http://lists.scilab.org/mailman/listinfo/users

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170510/d0f0b6da/attachment.htm>


More information about the users mailing list