how to check time in if statement?

17 ビュー (過去 30 日間)
632541
632541 2021 年 2 月 1 日
コメント済み: Adam Danz 2021 年 2 月 1 日
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 件のコメント
Adam Danz
Adam Danz 2021 年 2 月 1 日
See examples of correct usage of if statements testing for equality
632541
632541 2021 年 2 月 1 日
can I use vector in if to check condition?
Time is in vector and I want to check the test at particular time.

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2021 年 2 月 1 日
Read about tic toc.
  6 件のコメント
632541
632541 2021 年 2 月 1 日
I am using step block from simulink ,to get 5 amplitude i multiplied it with 5 from matlab function
code is written in matlab and step block is from simulink
Consider,
i want
0 to 100ns output zero ,
100 to 300 o/p 5 volt
300 to 500 o/p 0
500to 700 o/p 5
700 to 900 o/p 0
and till simulation time o/p zero.
Got my question?
Adam Danz
Adam Danz 2021 年 2 月 1 日
> Got my question?
We're asking you that question. What questions do you have?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInputs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by