Scilab
Posts  1 - 1  of  1
matiasb666
I'm trying to program function in scilab that calculates a regular timed samples of values. IE: I have a vector 'values' which defines contains the value of a signal at different times. This times are in the vector 'times'. So at time times(N), the signal has value values(N). At the moment the times are not regular, so the variable 'times' and 'values' can look like:

times = [0, 2, 6, 8, 14]
values= [5, 9, 10, 1, 6]
This represents that the signal had value 5 from second 0 to second 2. Value 9 from second 2 to second 6, etc.

Other option is to create a function that given a deltaT, samples the time and values vectors to produce an equally spaced timeVector and corresponding values. For example, with deltaT=2 and the previous vectors,

sampledTime = [0, 2, 4, 6, 8, 10, 12, 14]
sampledValues = [5, 9, 9, 10, 1, 1, 1, 6]

Is there anything already done in Scilab? How can this function be programmed?

Thanks a lot!
Save
Cancel
Reply
 
x
OK