INVERSE OF A FUNCTION
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
george veropoulos
el 16 de Dic. de 2020
Comentada: george veropoulos
el 21 de Dic. de 2020
HI i m looking for a script to inverse numericall a function
i use the function of inverse but not working because the functio is a liitle complicate
y=a*sin(x-ψ)+b*exp(-x/c) a,b,c are constand
thank you
2 comentarios
Alan Stevens
el 17 de Dic. de 2020
The right-hand side of your expression will result in an infinite number of values of y, so there won't in general be a unique inverse value. However, if you know the range of values of x that you are interested in then you might be able to get a corresponding value for y using, say, the function fzero.
doc fzero
Respuesta aceptada
Alan Stevens
el 18 de Dic. de 2020
For a gven target value of y you could write a script along the lines of
x0 = initial guess;
x = fzero(@fn, x0);
function z = fn(x)
a = ...
b = ...
etc.
z = a*sin(x-psi)+b*exp(-x/c) - ytarget;
end
fzero will return the value of x that makes z equal zero (to within the appropriate tolerance).
Más respuestas (1)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!