![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1352799/image.png)
need help with the simmulink blocks
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Chukwuebuka
el 12 de Abr. de 2023
Respondida: Bhanu Prakash
el 12 de Abr. de 2023
how do i generate this type of plot in simulink with the step block
0 comentarios
Respuesta aceptada
Bhanu Prakash
el 12 de Abr. de 2023
Hi Chukwuebuka,
As per my understanding, you want to re-create the waveform shown in the picture using simulink.
This can be achieved by using two "step" blocks. One block "Step" having "Step time" & "Final value" as 1 & 1 respectively and the second block "Step1" having "Step time" & "Final value" as 9 & -1 respectively.
Add these two blocks using an "Add" block. The resulting output is your required waveform.
Consider the block diragram shown below, for your reference:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1352799/image.png)
You can refer to the documentation of "step" block, for more info:
Hope this answer helps you.
Thanks,
Bhanu Prakash.
0 comentarios
Más respuestas (1)
Amit Dhakite
el 12 de Abr. de 2023
Editada: Amit Dhakite
el 12 de Abr. de 2023
Hi Chukwuebuka,
You can generate the required graph as shown by you in the attached image by using two step blocks and a switch block.
Configure the first step block to generate value 0, when x is in between 0 and 1. And after step time 1 units, give final value as 1. It will give output as follows:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1352774/image.png)
Configure the second step block to generate value 1 till the time 9 units, and after that set final value as 0. It will give output as follows:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1352779/image.png)
Finally, use switch block to get the values till 9 units of time from the step_1, and after that from step_2.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1352784/image.png)
A working example of the above model is attached here for you reference.
For further information, kindly refer to the following links:
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!