[Scilab-users] add number arrays efficiently, how?

Tim Wescott tim at wescottdesign.com
Thu Mar 23 00:50:26 CET 2017


On Thu, 2017-03-23 at 00:28 +0100, Samuel Gougeon wrote:
> Le 22/03/2017 à 23:15, Erhy a écrit :
> > 
> > Hello!
> > I'm thinking in arrays - and I write
> > 
> > SumArr = [ 1 2 3 ];  toAdd = [ 7 8 9 10 ];
> > SumArr( (length(SumArr)+1) : (length(SumArr)+length(toAdd)) ) =
> > toAdd;
> > 
> > How to code it smarter?
> SumArr = [SumArr toAdd]
> 

If you know them in advance, yes.  My answer was predicated on not
knowing "toAdd" at the same time as the 1x3 SumArr.

> -- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432






More information about the users mailing list