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
xlabel ('Time Index');
TITLE ('Ramp signal');
This time you may try yourself by replacing plot() with stem();