How do i plot this rect function and unit step function into matlab?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193769/image.png)
0 commentaires
Réponses (2)
madhan ravi
le 2 Nov 2018
1 commentaire
madhan ravi
le 2 Nov 2018
If you still don’t figure it out , post the code which you tried here so that it can be corrected .
Tilkesh
le 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;
end
0 commentaires
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!