MATLAB Answers

Error executing 'duration' operator in stateflow

2 views (last 30 days)
Dheemanth D
Dheemanth D on 4 Jun 2018
Edited: Amjad Elshenawy on 23 Sep 2019
I am trying to use a 'duration' logic operator in stateflow and unable to execute. I keep getting the following error:
The 'duration' class does not support code generation.

  1 Comment

Walter Roberson
Walter Roberson on 4 Jun 2018
I speculate that there is confusion between the duration operator of Stateflow and the duration datatype that is associated with datetime handling. I wonder how the code is intended to tell the difference?
Is it possible that you are applying duration to a number instead of to a logical result?

Sign in to comment.

Answers (1)

Amjad Elshenawy
Amjad Elshenawy on 23 Sep 2019
Edited: Amjad Elshenawy on 23 Sep 2019
Hello Dheemanth
I guess you was using the "duration" operator insude a truth table.
If my assumption is correct, then you shall use the duration oprator inside statflow but outside the truth table.
You shall assign the output of the duration operator to a local variable and then pass this local variable to the truth table. The truth table shall then reside inside the statechart.


Sign in to comment.

Sign in to answer this question.

Translated by