example to pick up data from simulink when trip signal active

2 ビュー (過去 30 日間)
Khalid
Khalid 2016 年 10 月 1 日
コメント済み: Swarooph 2016 年 10 月 5 日
Hi Guys
I have a model in simulink, I would like to record the time for me when my trip signal is initiated (time for 0 & time for 1) since I would like to record the data of time, voltage, current when my trip signal (zero or one). As you can see from the attached image, the Iex_trip block is the trip signal output.
Thanks in advance

採用された回答

Swarooph
Swarooph 2016 年 10 月 4 日
What is the 'Save Format' of your To Workspace or To File block? If it is Array, you need to switch it to either Time Series, or Structure With Time (whichever is available) to record data AND time. Take a look at this documentation for more info.
  2 件のコメント
Khalid
Khalid 2016 年 10 月 5 日
Hi Swarooph, thanks for taking a time to replay me.
Yeah I saved my data to workspace but I would like to ask if there an function/block could pickup for me only the period of my trip when is initiated as (1) neglecting (0) since it take a bit of time to go and find the data for those trip signals.
Swarooph
Swarooph 2016 年 10 月 5 日
Short answer: You can create a new signal that is representative of times when your trip signal is 1 and then record that.
Long answer: Use a clock block in your model and multiply that with the trip signal. The output of this product operation will be a signal that has the time values when the trip signal is 1 and 0 when the trip is 0. Let's call this signal data recordedTime. Once the simulation is done, you can simply say recordedTime(recordedTime>0) in MATLAB command window to get all the values of time for which the trip signal was 1.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNonlinear Operators についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by