How do i plot this rect function and unit step function into matlab?
6 views (last 30 days)
Show older comments
See rectangularpulse and piecewise are sufficient enough to finish your homework.
Remark: use symbolic variables using symbolic toolbox
If you still don’t figure it out , post the code which you tried here so that it can be corrected .
Tilkesh on 28 Mar 2022
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;
Find more on Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!