How to change the sample time?
14 次查看(过去 30 天)
显示 更早的评论
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 个评论
Azzi Abdelmalek
2012-12-5
It's not clear, you have data from workspace, and you want to export those data to workspace!
采纳的回答
Azzi Abdelmalek
2012-12-5
For each signal use one scope with it's sample time
2 个评论
Azzi Abdelmalek
2012-12-6
Ok, then don't use sample time in your scope, let sampling option on decimation
更多回答(1 个)
TAB
2012-12-6
编辑:TAB
2012-12-6
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)];
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!