I have a function, which takes reminder of time from total time set. What I am trying to do is whenever my cyc = 0 at that instant only the input B of function should be changed. Also, at that instant the time t should reset and start from 0.
Can anyone guide me on how should I do it?
Thanks

 採用された回答

VBBV
VBBV 2022 年 11 月 11 日
編集済み: VBBV 2022 年 11 月 11 日

0 投票

B = 1; % usual input B value
if cyc == 0
B = 3; % input a different B value when cyc = 0
y = myFun(B)
time = 0;
end
function y = myFun(B)
% your function code
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

製品

リリース

R2022a

タグ

質問済み:

2022 年 9 月 13 日

編集済み:

2022 年 11 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by