how to check time in if statement?
Show older comments
In if statement i want to check the timing of the signal . I mean for zero second output is 5 else 2 . And this repeats for few other conditions of time.
like,
If t=0
res=5;
elseif t=6
res=7;
else
res=0;
(all times in seconds)
3 Comments
Daniel Pollard
on 1 Feb 2021
What exactly is your question?
Adam Danz
on 1 Feb 2021
See examples of correct usage of if statements testing for equality
632541
on 1 Feb 2021
Answers (1)
KSSV
on 1 Feb 2021
0 votes
Read about tic toc.
6 Comments
632541
on 1 Feb 2021
632541
on 1 Feb 2021
KSSV
on 1 Feb 2021
Show us the complete code and the error.
The error is here
If t=0
and the OP should be able to figure this one out by looking at examples in the documentation.
632541
on 1 Feb 2021
Adam Danz
on 1 Feb 2021
> Got my question?
We're asking you that question. What questions do you have?
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!