function y =bumpy(x)
%this function draws a bumpy curve
y=1/(4*pi)*(1./((x-2).^2+1)+1./((x+0.5).^4+32)+1./((x+1).^2+2));
%This is how to integrate the function on (-3,3), with tolerance of 10^(-6)
quad('bumpy', -3, 3, 10^(-6))
%This is how to find the minimum boundary of x and y, on (-1.2, 1)
xmin=fminbnd('bumpy',-1.2, 1)
ymin=bumpy(xmin)
%How to find the maximun boundary?
%find minimum boundary for y=-f(x)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjymFIbHxZaeMlTRygp-CdKO6NKU1ne2A3v_ncaIv-AnKi2uNg321frCnOYUq06Q84F8H0wUCQESzm_NVA_jFimGVJCpVgU4ph4kd2nhgyWQB7vFyz8S4fYkuiuTHwLfjR3K3D0GC_lVTVi/s320/bumpy.png)
%This is example is from Introduction to Matlab with numerical preliminaries by Alexander Stanoyevitch.
No comments:
Post a Comment
Any comments?