Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Rabalessons
- function y = aplicar(f,var,x)
- deff("z=F("+var+")","z="+f)
- y = F(x)
- endfunction
- function y = derivame(fun, var, orden, step, valor)
- if orden == 0 then
- y = aplicar(fun, var, valor)
- else
- deff("z = Pepe0("+var+")", "z =" + fun)
- for i=1:orden-1
- deff("z = Pepe"+string(i)+"("+var+")", "z = numderivative(Pepe"+string(i-1)+","+var+","+string(step)+",4)")
- end;
- deff("z = Fin("+var+")", "z = numderivative(Pepe"+string(orden-1)+","+var+","+string(step)+",4)")
- y = Fin(valor)
- end;
- endfunction
- #La llamada a la funcion fue algo como...
- -->derivame("2*Carlos ** 2 + 5*Carlos + 3", "Carlos", 1, 0.01, 10)
- ans =
- 45.
- -->derivame("2*Carlos ** 2 + 5*Carlos + 3", "Carlos", 2, 0.01, 10)
- ans =
- 4.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement