0

I have a problem in understanding how to incorporate a c-code block in order to measure the rising and falling edges of a square wave signal in Simulink. I am using a signal generator to generate a square wave and I need to measure the rising edge and falling edge of the signal using the c-script block in Simulink. How do I do that? Thanks in advance

  • This sounds like homework. Could you please tell us what you've tried, and where you got stuck? – TimWescott Aug 04 '22 at 14:08
  • I have difficulty in writing the C code to measure the time intervals between rising edge and falling edge of the square wave generated from signal generator. – Pranoy Sanyal Aug 04 '22 at 17:19
  • Detecting the rising edge and falling edge has been obtained by the use of a delay and comparator block. I could not figure out how to get the time values in between the edges using the c code block – Pranoy Sanyal Aug 04 '22 at 17:20

0 Answers0