Data inspector displays two signals in different ways
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Nehemiae
on 8 Mar 2023
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 Comments
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!