Hello everyone,
I have a system that is shown below.
Inside the Sensor Block I have some initial values and basic calculations like below;
function [distance,sensorID] = fcn(trig)
sensorID = 1;
distance = (trig/2)*(17.15);
with the current structure I can display all the values correctly.However, my aim is to display distances with delays from each other.
For instances I want to display;
Display[Distance] at the beginning
Display[Distance]2 after 3 seconds
Display[Distance]1 after 6 seconds
I have already tried pause function but it makes the function in the block to restart constantly and that is something I avoid. All I need to display values once and after a second turn back to zero,if possible.
If not values can remain on the display,as well.
I hope I could have explained the issue clear enough.Please let me know if there is any other point that I need to clarify.
Thanks in advance!

 Respuesta aceptada

maiaL
maiaL el 29 de Jul. de 2020

0 votos

Have you tried Delay blocks?

3 comentarios

Dermansah Hazar Ersoy Yalin
Dermansah Hazar Ersoy Yalin el 3 de Ag. de 2020
Editada: Dermansah Hazar Ersoy Yalin el 3 de Ag. de 2020
Thank you for your answer.
I have tried but not sure if I found out the correct way to use or it basically did not work.
Do you mind if I ask you how would you use the delay block in this case?
Thanks again.
maiaL
maiaL el 4 de Ag. de 2020
Editada: maiaL el 4 de Ag. de 2020
You can place a Delay block before each of the inputs of the second and third sensor blocks. The delay length would depend on your step size. For example:
If your step size is 0.1, and you want a 3s delay, the delay length (in samples) would need to be 30.
Maybe not the most elegant solution but it might be enough for you.
Thank you very much.It works now.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre General Applications en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by