필터 지우기
필터 지우기

Data inspector displays two signals in different ways

조회 수: 1 (최근 30일)
Niels
Niels 2023년 1월 10일
답변: Nehemiae 2023년 3월 8일
I have two signals and they are displayed in different styles in the data inspector. I turned on markers with the command line to better display the problem. The top graph displays the value of the last marker until the new marker. The bottom graph shows a straight line between the two markers. Can i change this?

답변 (1개)

Nehemiae
Nehemiae 2023년 3월 8일
Hello,
This appears to be because the signal ‘Warmtetransport door thermische schil” has been set with the interpolation property “zoh”, which is zero-order hold. In this case, the Data Inspector will use the same data sample as the previous sample for the interpolated time samples. Whereas in linear interpolation, the Data Inspector will approximate the interpolated value. The below code changes the required property in a ramp signal in Simulink.
ramp = out.logsout.get(1);
ramp.Values.DataInfo.Interpolation = 'zoh'; % To set the signal with zoh interpolation
ramp.Values.DataInfo.Interpolation = 'linear'; % To set the signal with linear interpolation
This is the case when setting the interpolation to zero order hold.
This is the case when setting the interpolation to linear.
The documentations on Simulink signals (https://www.mathworks.com/help/simulink/slref/simulink.sdi.signal.html) and on how the Data Inspector compares data (https://www.mathworks.com/help/simulink/ug/how-the-simulation-data-inspector-tool-compares-time-series-data.html) are helpful in understanding this workflow.

카테고리

Help CenterFile Exchange에서 Analyze Simulation Results에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by