| |
| | [No title] (Site not responding. Last check: 2007-10-20) |
 | | % z=x*(1.2-x); y=z; if (nargin==2), zp = -2*x + 1.2; zpp = -2; y=[z zp zpp]; end; %END function y = f2(x,k); % % f2: returns function value, and first two derivatives % if the second argument k=2 is used. |
 | | % z=exp(x) + x.^2/2 - 2*x; y=z; if (nargin==2), zp = exp(x) + x -2; zpp = exp(x) + 1; y=[z zp zpp]; end; %END function y = f3(x,k); % % f3: returns function value, and first two derivatives % if the second argument k=2 is used. |
 | | % z=1 - x.*cos(pi*x/2); y=z; if (nargin==2), zp = - cos(pi*x/2) + (pi/2)*x.*sin(pi*x/2); zpp = pi*sin(pi*x/2) + (pi/2)^2*x.*cos(pi*x/2); y=[z zp zpp]; end; %END function y = f4(x,k); % % f4: returns function value, and first two derivatives % if the second argument k=2 is used. |
| www.cs.sfu.ca /pub/math/pub/mrt/309/progs/func3 (179 words) |
|