Saturday, June 25, 2011

MATLAB Programs 01: Generating a ramp signal/sequence


Below given is a program to generate a ramp signal. The program is almost self explanatory.

% Program to generate a ramp signal

n=input('Enter the length of ramp sequence N = ');  % Get the length
s=input(' Enter the slop of the ramp S = ');  % Get the slop of the ramp
t=0:n-1;
plot(t,s*t);
ylabel ('Amplitude');
xlabel ('Time  Index');
TITLE ('Ramp signal');



This time you may try yourself by replacing plot() with stem();

6 comments:

Anonymous said...

Great Job Anil, your post is really helpful!

Anonymous said...

what if they ask ramp sequence with samples of 100 and sampling rate of 20kHz?

আগোছালো হিজিবিজি said...

Excellent boss (y).. it's really helpful

Anonymous said...

nice

Rahul Kambale said...

nice

Nitesh Kumar said...

I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in MATLAB, kindly contact us http://www.maxmunus.com/contact
MaxMunus Offer World Class Virtual Instructor led training on MATLAB. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us.
Nitesh Kumar
MaxMunus
E-mail: nitesh@maxmunus.com
Skype id: nitesh_maxmunus
Ph:(+91) 8553912023
http://www.maxmunus.com/




Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes