Question

Write MATLAB code to plot the following waveforms.    Rectangular pulses: ????(?) ????(? − ?) ????(?/?)  ...

Write MATLAB code to plot the following waveforms.   

  1. Rectangular pulses:
    1. ????(?)
    2. ????(? − ?)
    3. ????(?/?)  

For ? and ?, choose any values that make sense.

  1. Triangular pulses:
    1. Δ(?)
    2. Δ(? − ?)
    3. Δ(?/?)   

For ? and ?, choose any values that make sense.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)

clc;close all;clear all;

%rect(t)

x=@(t) (t>=-0.5 & t<=0.5);

T=1;tow=2;

t=-2:0.001:2;

figure;

subplot(221);plot(t,x(t));xlabel('t');ylabel('rect(t)');title('rect(t)');grid;

subplot(222);plot(t,x(t-T));xlabel('t');ylabel('rect(t-1)');title('rect(t-1)');grid;

subplot(223);plot(t,x(t/tow));xlabel('t');ylabel('rect(t/tow)');title('rect(t/2)');grid;

2)

clc;close all;clear all;

%triangular pulses

x=@(t) (1-(abs(t))).* (t>=-1 & t<=1);

T=1;tow=2;

t=-2:0.001:2;

figure;

subplot(221);plot(t,x(t));xlabel('t');ylabel('tri(t)');title('tri(t)');grid;

subplot(222);plot(t,x(t-T));xlabel('t');ylabel('tri(t-1)');title('tri(t-1)');grid;

subplot(223);plot(t,x(t/tow));xlabel('t');ylabel('tri(t/tow)');title('tri(t/2)');grid;

Add a comment
Know the answer?
Add Answer to:
Write MATLAB code to plot the following waveforms.    Rectangular pulses: ????(?) ????(? − ?) ????(?/?)  ...
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
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