How do i plot this rect function and unit step function into matlab?

回答(2 个)

See rectangularpulse and piecewise are sufficient enough to finish your homework.
Remark: use symbolic variables using symbolic toolbox

1 个评论

If you still don’t figure it out , post the code which you tried here so that it can be corrected .

请先登录,再进行评论。

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

类别

帮助中心File Exchange 中查找有关 Labels and Styling 的更多信息

标签

提问:

2018-11-2

回答:

2022-3-28

Community Treasure Hunt

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

Start Hunting!

Translated by