Targeting specific samples and extracting the data from the that signal

2 次查看(过去 30 天)
I have a frequency signal which is the output of a subsystem in Simulink (I have attached an image how the signal looks like and also the subsystem from which this signal appears an output). I want to extract data from this signal i.e System_Freq signal whenever this signal starts decreasing until it reaches a point let say 49.7 Hz or in other words I want to target the samples surrounding the frequency excursion which is also shown by the dotted blue window in the image (Frequency_signal) attached. Any suggestions?

回答(2 个)

Pravarthana P
Pravarthana P 2022-12-2
I understand you are trying to extract the data from Simulink signal, the following workaround may help you to perform the desired function:
  • Configuring the signal to be exported to workspace by right clicking on the signal and selecting “log selected signals”. More customization on how the signal has to be logged can be done in "Data Import/Export" section of Configuration parameters. For more information refer to the following documentation:
  • By using "To Workspace" block the signal can be logged into Workspace and subsequently to a MAT file. To learn more about this block refer to the following documentation:
Once, the signal is logged the required frequency operation can be done by using a programmatic approach. The following MATLAB answer could be referred for extracting the requried frequency:
  1 个评论
Taimoor Khan Mehmand
编辑:Taimoor Khan Mehmand 2022-12-2
Hi Pravarthana,
Thank you for your comment.
However, I don't want to perform the signal logging and sending the desired signals to MATLAB workspace. I wanted to find the value of my system's frequency signal "rate of change of frequency i.e ROCOF" only and that by using " Simulink Matlab function block".
The reason behind using the "Matlab function block" is that I will have to use the " Rate of Change of Signal" to feed to another blocks of simulink model.

请先登录,再进行评论。


Pravarthana P
Pravarthana P 2022-12-9
I understand that you are trying to find the “Rate of Change of Signal” using a Simulink block, the following workaround may help you:
The Derivative block approximates the derivative of the input signal u with respect to the simulation time t Thereby, by passing the signal of interest through the Derivation block the rate of change of the signal might be obtained. For more information on the Derivative block, the following documentation link may be helpful:
Hope this information helps you!

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by