How to change the sample time?

9 visualizzazioni (ultimi 30 giorni)
sewook
sewook il 5 Dic 2012
Hello,
Only I want is recording a data to workspace with scope.
There is data like below (from workspace):
[t , v]
0.0 , 4.5
0.1 , 4.45
0.2 , 4.43
0.3 , 4.3
... , ...
10.0 , 4.0
20.0 , 4.1
30.0 , 4.15
..., ...
10000.0 , 4.2
A sampling time of part of data has a value per 0.1sec, the other part has a value per 10sec. (it can be larger than 10sec)
After some calculation, I wolud like to record this data using a scope. But I can set only one sampling time value in the scope parameter. TT
If I set the sampling time 0.1sec, the data is too much, and if I set the sampling time 10sec, the 0.1sec data are gone.
Accoring to input(from workspace block), I would like to change the sampling time. is it possible? or how can I fix this problems...?
  2 Commenti
Azzi Abdelmalek
Azzi Abdelmalek il 5 Dic 2012
It's not clear, you have data from workspace, and you want to export those data to workspace!
sewook
sewook il 6 Dic 2012
My purpose is comparing original data and simulated data, so the sampling time should be matched. Thank you for your advice. In case of long data, I should find another methoad about it.

Accedi per commentare.

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 5 Dic 2012
For each signal use one scope with it's sample time
  2 Commenti
sewook
sewook il 6 Dic 2012
there is only one signal. The signal has different sample time like above.(some signal has 0.1sec sample time, some signal has 10sec sample time.)
Azzi Abdelmalek
Azzi Abdelmalek il 6 Dic 2012
Ok, then don't use sample time in your scope, let sampling option on decimation

Accedi per commentare.

Più risposte (1)

TAB
TAB il 6 Dic 2012
Modificato: TAB il 6 Dic 2012
It is not possible to log the same signal with different sample time. For your case use lowest sample time (0.1 sec) to log the scope data. From the logged data you can extract the values at sample times you need.
For example ScopeData is the variable logged by scope. You can extract your values as
Myt1 = [0.0:0.1:0.3]';
Myt2 = [10:10:1000]';
[~, Idx1, ~] = intersect(ScopeData.time,Myt1);
[~, Idx2, ~] = intersect(ScopeData.time,Myt2);
MyValues = [ScopeData.signals.values(Idx1) ; ScopeData.signals.values(Idx2)];

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by