Function Handle for a Rectangular Function
2 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Voss
2022-4-12
% rect = @(t)double(0<=t & t<=1); % returns double array (1/0)
rect = @(t)0<=t & t<=1; % returns logical array (true/false)
t = -1:0.01:2;
plot(t,rect(t));
ylim([-1 2]);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!