How can i implement a clock series?

1 view (last 30 days)
chuyen hoangcao
chuyen hoangcao on 14 Feb 2021
This is my code i used for matlab function block and it goes straight to scope .But it does not work in the scope.
function [Th1,Th2] = fcn(t)
if (0<t)&&(t<10)
Th1 = 0;Th2=0;
elseif (10<t)&& (t<11.2)
Th1 = 100;Th2=100;
elseif (11.2<t)&&(t<12.5)
Th1 = 100;Th2=50;
elseif (12.5<t)&&(t<13)
Th1 = 80;Th2=53;
elseif (13<t)&&(t<13.8)
Th1 = 60;Th2=36;
elseif (13.8<t)&&(t<25.1)
Th1 =100;Th2=100;
elseif (25.1<t)&&(t<26)
Th1 = 55;Th2=100;
elseif (26<t)&&(t<33.5)
Th1 = 0;Th2=10;
elseif (33.5<t)&&(t<50)
Th1 = 0;Th2=0;
else
Th1 = 0;Th2=0;
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!