how to check time in if statement?

20 views (last 30 days)
632541
632541 on 1 Feb 2021
Commented: Adam Danz on 1 Feb 2021
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
632541
632541 on 1 Feb 2021
can I use vector in if to check condition?
Time is in vector and I want to check the test at particular time.

Sign in to comment.

Answers (1)

KSSV
KSSV on 1 Feb 2021
Read about tic toc.
  6 Comments
Adam Danz
Adam Danz on 1 Feb 2021
> Got my question?
We're asking you that question. What questions do you have?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!