Re: [Scilab-users] {EXT} Re: add number arrays efficiently, how?

2017-03-24 Thread Rafael Guerra
with no logic to respect the SumArr orientation the following is even
simpler:

[SumArr(:); toAdd(:)]

Rgds,
Rafael



--
View this message in context: 
http://mailinglists.scilab.org/add-number-arrays-efficiently-how-tp4035946p4035978.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} Re: add number arrays efficiently, how?

2017-03-24 Thread Dang Ngoc Chan, Christophe
Hello,

> De : Rafael Guerra
> Envoyé : vendredi 24 mars 2017 13:16
>
> Your code only works if the input arrays are  oriented similiarly (both 
> column or row vectors).
> [...]
>
> SumArr = [ 1 2 3 ];
>  toAdd = [ 7 8 9 10 ]'

You can transform it to line vectors (or column vectors) with matrix():

[matrix(SumArr, 1, size(SumArr, "*")), matrix(toAdd, 1, size(toAdd, "*"))]

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users