I have a problem in MATLAB Simulink.
이전 댓글 표시
So, I want to build the simulink model with "Matlab funcion" as a block. Which has input and output. Now, I have taken sine wave as an input. so "u = sin wave" here I have used "Sin wave" block. Now in function block i have added function as below,
I have attched screenshot of simulink model.
function y = fcn(u)
t_span = 5
y = u(t<t_span);
Here in order to calculate the value of y, I need time "t". So that I can compare it with "t_span". So, When I try to write parameter into "fcn(u)" as "fcn(u(t))" it creates another input port in function block.
So, My question is how can i use internal parameter "t" of sine wave block as a variable for different equations ??
Thank you.
댓글 수: 4
If
, then what is
?
I don't know how to interpret the function.
Can you make a basic plot for
, so that it can be interpreted into the MATLAB Function block?
t = linspace(0, 2*pi, 2*1800+1);
u = sin(t);
plot(t, u, 'linewidth', 1.5),
grid on, xlabel('\it{t}'), ylabel('\it{u}(\it{t})')
Shiv Nileshkumar Matliwala
2022년 9월 13일
Sam Chak
2022년 9월 13일
@Shiv Nileshkumar Matliwala, Before answering your queries, here is a straightforward request:
- Please sketch the desired output waveform of the MATLAB Function block.
- If you know the equation of the desired output, please display it here.
Shiv Nileshkumar Matliwala
2022년 9월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

