Targeting specific samples and extracting the data from the that signal

2 views (last 30 days)
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?

Answers (2)

Pravarthana P
Pravarthana P on 2 Dec 2022
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 Comment
Taimoor Khan Mehmand
Taimoor Khan Mehmand on 2 Dec 2022
Edited: Taimoor Khan Mehmand on 2 Dec 2022
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.

Sign in to comment.


Pravarthana P
Pravarthana P on 9 Dec 2022
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!

Community Treasure Hunt

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

Start Hunting!