[Scilab-users] inserting data into a bigger matrix

Philipp Mühlmann p.muehlmann at gmail.com
Wed Oct 12 14:16:21 CEST 2016


Dear Scialb users,


how to insert time based data into a pre-defined Matrix without using a
for-loop?

The data points are not equally spaced in time.


example:
// assuming DATA includes 5 data Points
// each dat Point consists of 4 variable
// first variable = time

//datafile could look like

Time, Var1, Var2, Var3
0, 0, 0, 1
10, 0, 3, 1
15, 30, 0, 1
18, 0, 45, 0
36, 57, 28, 0

Assume that a timestep of 1 second is wanted.

desired result should look like this:

M =
0 0 0 1
1 0 0 0
2 0 0 0
3 0 0 0.
...
10 0 3 1
...
15 30 0 1
...
18 0 45 0
...
36 57 28 0

so "M" is bigger than the original dataset.

Again, I think I could do this using for-loops.
This could be OK for small dataset, but maybe become slow for huge data
sets (> 100'000 data points).

Thanks,
Philipp




Thanks,
Philipp





-- 
In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.

There we have the salad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161012/6b040a3a/attachment.htm>


More information about the users mailing list