Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

MATLAB code for discrete RAMP Function


 MATLAB CODE 

clc; clear all; close all;

n1 = -3;

n2 = 3;

no = -1; %+ve-->Lag and -ve-->Lead

n = n1:n2;

N = length(n);

x = [(n-no)>=0];

R = 0;

for j = 1:N

    if x(j) == 1

        R = R+1;

        my_ramp(j) = R;

    else

        my_ramp(j) = 0;

    end

end

figure(6)

stem(n,my_ramp)

title('unit ramp function')

 




Join us on Telegram: https://t.me/matlabcastor

No comments

Popular Posts

Followers