How can I calculate value of a signal (using MATLAB Function block of Simulink) between two time instants i.e. between 5.04 s to 5.25 s?
1 次查看(过去 30 天)
显示 更早的评论
Actually I have a signal (figure attached) which is a frequency signal and that signal would be input to the " MATLAB Function block of Simulink" . So this input signal is not a vector, it is just a one dimension signal of 50Hz value and the value changes at 5 seconds because there is a disturbance event at 5 seconds. So eventually , I want to find the value between 5.04s to 5.25s (which is actually the rate of change of this signal between 5.04s to 5.25s). Also I don't know how many samples do I need to take between 5.04s to 5.25s in order to have accurate rate of change of this signal. Can anyone please guide or anyone have any idea how to do this using MATLAB Function block of the Simulink?
1 个评论
Mathieu NOE
2023-1-2
hello
why not using a buffer block to store the samples (for a duration of 0.2 s) then use the math block with mean(diff(u))
NB : your solver must use fixed time steps dt
the output of the math block then needs to be divided by dt to get the average slope of the frequency signal
a simpler alternative (IMHO) is to use a first order high pass filter (used as a frequency limited derivator).
回答(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!