I have a problem in MATLAB Simulink.
Mostrar comentarios más antiguos
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 comentarios
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
el 13 de Sept. de 2022
Sam Chak
el 13 de Sept. de 2022
@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
el 14 de Sept. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

