How do i plot this rect function and unit step function into matlab?
4 次查看(过去 30 天)
显示 更早的评论
回答(2 个)
madhan ravi
2018-11-2
1 个评论
madhan ravi
2018-11-2
If you still don’t figure it out , post the code which you tried here so that it can be corrected .
Tilkesh
2022-3-28
function y = rect(x, D)
% function y = rect(x, D)
if nargin == 1, D = 1;
x = abs(x);
y = double(x<D/2);
y(x == D/2) = 0.5;
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!