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

조회 수: 68 (최근 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 CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by