Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [dydx] = der(f,x,h)
- dydx = (1/3)*(((f(x+h)-f(x-h))./(2*h))-((f(x+(2*h))-f(x-(2*h)))./(4*h)))
- end
- function [d1,d2,d3] = pder(g,x1,h1,x2,h2,x3,h3)
- d1 = (1/3)*(((g(x1+h1,x2,x3)-g(x1-h1,x2,x3))./(2*h1))-((g(x1+(2*h1),x2,x3)-g(x1-(2*h1),x2,x3))./(4*h1)))
- d2 = (1/3)*(((g(x1,x2+h2,x3)-g(x1,x2-h2,x3))./(2*h2))-((g(x1,x2+(2*h2),x3)-g(x1,x2-(2*h2),x3))./(4*h2)))
- d3 = (1/3)*(((g(x1,x2,x3+h3)-g(x1,x2,x3-h3))./(2*h3))-((g(x1,x2,x3+(2*h3))-g(x1,x2,x3-(2*h3)))./(4*h3)))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement