Scilab: move std_vector to upper directory
This commit is contained in:
parent
84f1e3d3e2
commit
a7181c3c93
4 changed files with 1 additions and 1 deletions
37
Examples/scilab/std_vector/runme.sci
Normal file
37
Examples/scilab/std_vector/runme.sci
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
lines(0);
|
||||
exec loader.sce;
|
||||
SWIG_Init();
|
||||
|
||||
|
||||
disp(mean([1,2,3,4]));
|
||||
|
||||
// ... or a wrapped std::vector<int>
|
||||
|
||||
v = new_IntVector();
|
||||
for i = 1:4
|
||||
IntVector_push_back(v, i);
|
||||
end;
|
||||
disp(average(v));
|
||||
|
||||
|
||||
// half will return a Scilab matrix.
|
||||
// Call it with a Scilab matrix...
|
||||
|
||||
disp(half([1.0, 1.5, 2.0, 2.5, 3.0]));
|
||||
|
||||
|
||||
// ... or a wrapped std::vector<double>
|
||||
|
||||
v = new_DoubleVector();
|
||||
for i = 1:4
|
||||
DoubleVector_push_back(v, i);
|
||||
end;
|
||||
disp(half(v));
|
||||
|
||||
// now halve a wrapped std::vector<double> in place
|
||||
|
||||
halve_in_place(v);
|
||||
disp(v);
|
||||
|
||||
exit
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue