Info
此问题已关闭。 请重新打开它进行编辑或回答。
to compare the floating value of a signal with file.mat signal
2 次查看(过去 30 天)
显示 更早的评论
Hi,
In a simulink simulation i've "recorded" a signal in a file.mat. Now, in an other simulation i need to compare a new signal with file.mat-signal (i'll call file.mat-signal as m(t)).
For example with the floating value f(t) of the new signal (in the new simulation) i need to know the time t such that:
abs(f(t)-m(t)) < some tolerance value
I know that t is an element of the file.mat matrix, but i don't know how i can do the comparison in simulink.
0 个评论
回答(1 个)
Seth Popinchalk
2011-3-30
You can build the equation using blocks from the Math Operations and Logic and Bit Operations libraries.
You will need an ABS block, a Sum Block and you could use the Compare to Constant to make the comparison to the tolerance value. This produces a signal that will be 1 when the condition is true. That can be used to trigger or enable a conditionally executed subsystem.
3 个评论
Kaustubha Govind
2011-3-30
Does your data in the MAT-file conform to the required format for From File (see http://www.mathworks.com/help/toolbox/simulink/slref/fromfile.html)? Also see the heading "Simulation Time Hits That Have No Corresponding MAT-File Time Stamps".
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!