Data inspector displays two signals in different ways
2 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
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.
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!