Generate data with the function y = ax3 + bx2 + cx + d in the range of x as it
varies from 0 to 2 with step increase of h . Assign suitable values of constants a, b, c and d.
Also assume the increment h to any value in between 0.1 to 0.25.
a = 1;
b = 2;
c = 3;
d = 4;
h = 0.1;
x = 0:h:2;
y = a*x.^3 + b*x.^2 + c*x +d
Comments
Leave a comment