Question

Matlab code using heaviside






1. Create an m-file that will generate a rectangular pulse mathematically defined as The user of the m-file can select the parameter # which must be positive and the rectangular pulse must equal 1 all the way to include the end points # and Provide the code of the m- file and provide the code showing that you tested this m-file by generating a CT pulse of width running from -5 to 5 and a DT pulse of width running from -6 to 6. Include the diagrams of the plots of the two pulses generated
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a. CT signal

clc;
close all;
tmin=-10;dt=0.1;tmax=+10;
t=tmin:dt:tmax;
x1=1;
x2=0;
x=x1.*(t>=-5&t<=5)+x2.*(t<-5&t>5);
plot(t,x);

OUTPUT

0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 10 -8 6-4-20 2 68 10

b.DT signal

clc;
close all;
n=-10:1:10;
x1=1;
x2=0;
x=x1.*(n>=-6&n<=+6)+x2.*(n<-6&n>6);
stem(n,x);

Add a comment
Know the answer?
Add Answer to:
Matlab code using heaviside 1. Create an m-file that will generate a rectangular pulse mathematically defined...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • General Guidelines MATLAB Symbolic Computations are NOT allowed for this assignment. Generate ALL plots using MATLAB....

    General Guidelines MATLAB Symbolic Computations are NOT allowed for this assignment. Generate ALL plots using MATLAB. Include your MATLAB codes as an appendix at the end of your document. All plots should be clearly labeled: provide a X-axes and y-axes labels, specify units as needed, add titles and legend as needed, add grids as needed, use different line stiles and/or symbols as needed. 6) Consider the CT signal X(t) = u(t)- r(t) +r(t-1), where r(t) = t.u(t). a) Derive the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT