I'm familiar with python, however. What I want to do is create an
empty list [] and put numbers in it. In python, this is
straightforward,
a=[]
a.append(1)
print a
a=[1]
etc
easy stuff!
What is the Scilab equivalent?
For arrays, it's:
a = [];
a(1) = 1;
a(2) = 2;
etc.
Or
a = [];
a($+1) = 1;
a($+1) = 2;
or
a = [];
a = [a; 1];
a = [a; 2];
Note that all of these can be slow: when Scilab appends a number to an
array it has to allocate memory for a bigger array, copy, then shove in
the number. If you know beforehand how big the array is going to be,
it's best to preallocate it:
a = zeros(big, 1);
a(1) = this;
a(2) = that;
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" was written for you.
See details at http://www.wescottdesign.com/actfes/actfes.html