How can I use a time dependent function as input source for my Simulink Model?

100 ビュー (過去 30 日間)
That is the defined function in my Matlab Function Block: The Result should be a curve the the Time t should be a interval e.g. from 0 to 10 How can I enter the time?
function i8_20 = fcn(t) %#codegen
ipeak=10000;
i8_20 = (ipeak/0.616)*sin(0.12*10^6*t)*exp.(-(t/(24.1e-06)));

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 4 日
You can use the clock block to get the time. http://www.mathworks.com/help/simulink/slref/clock.html
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 5 日
This depends on your stop time in model configuration parameters
Vishnu Panchal
Vishnu Panchal 2019 年 1 月 12 日
My stop time is 2 sec. Now, if i make use clock block it just gives me two steps. I want to reduce its step time to 100usec. How should I do it?

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

その他の回答 (1 件)

Robin Henne
Robin Henne 2020 年 1 月 2 日
you could try it with a triggered subsystem, which is triggered with a pulse generator with a period time of 100us

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by