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

4 visualizzazioni (ultimi 30 giorni)
John Marl il 2 Nov 2018
Risposto: Tilkesh il 28 Mar 2022
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (2)

madhan ravi il 2 Nov 2018
See rectangularpulse and piecewise are sufficient enough to finish your homework.
Remark: use symbolic variables using symbolic toolbox
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
madhan ravi il 2 Nov 2018
If you still don’t figure it out , post the code which you tried here so that it can be corrected .

Accedi per commentare.

Tilkesh il 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 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Line Plots in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by