How to Converting sine wave to a square wave in stateflow without invoking simulink function?

i tried using the formula square(t) = sgn(sin(2πt)), but it how can the time period calculated by stateflow. and if we invoke simulink fn what has to be done?
thanks in advance

3 comentarios

What do you mean by time period, Sample time OR current simulation time ?
Do you want to generate a square wave, or to transform a sine wave to a square wave. If it's a second option, where did the sine wave come from? from Simulink? or generated in Stateflow?
transform sine wave to a square wave, sine wave is an input from simulink. time period that i mentioned is the sample time.

Iniciar sesión para comentar.

 Respuesta aceptada

Even though it is not clear what you want to do, I have attached image to describe how you can work with Simulink function.

Más respuestas (1)

If you need a time value, in your Simulink model, add a clock block from Simulink/Sources and connect it as an input to your Stateflow chart

Categorías

Más información sobre Simulink Functions en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 6 de Dic. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by