필터 지우기
필터 지우기

How to change the sample time?

조회 수: 9 (최근 30일)
sewook
sewook 2012년 12월 5일
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
Azzi Abdelmalek 2012년 12월 5일
It's not clear, you have data from workspace, and you want to export those data to workspace!
sewook
sewook 2012년 12월 6일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 5일
For each signal use one scope with it's sample time
  댓글 수: 2
sewook
sewook 2012년 12월 6일
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 2012년 12월 6일
Ok, then don't use sample time in your scope, let sampling option on decimation

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

TAB
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)];

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by