How do we write a code for a periodic intermittent scalar function?
8 次查看(过去 30 天)
显示 更早的评论
I would like to write a code of an periodic intermittent bounded control. I've tried to write it as a piecewise function but its not giving me type of output I want. Can someone help please? This what I have written
K = 0:0.01:1;
Pk =[];
m = 4; h = 0.1; T = 0.05;
for k = 1:length(K)
if (K(k) >= m*T & K(k) < m*T + h)
pk = 4;
elseif (K(k) >= m*T + h & K(k) < (m+1)*T)
pk = 0;
end
Pk = [Pk pk];
end
4 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

