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 Facebook Group:
https://www.facebook.com/groups/matlabcodes
Sir, please add the code for approximation of fixed point of ishikawa iterative process which is
ReplyDeletey_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]