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

1 comment:

  1. Sir, please add the code for approximation of fixed point of ishikawa iterative process which is
    y_n=(1-b_n)*x_n+ b_n* f(x_n)
    x_n+1=(1-a_n)*f(x_n)+a_n*f(y_n)
    where a_n and b_n have values less than 1 and greater than 0 in expression form and while using the two phase function with interval like
    f(x)= x^2 if x belongs to [0, 0.5)
    = {0} if x belopngs to [0.5, 1]

    ReplyDelete