how to find x from a fixed y, when using a sigmoidal fit
Afficher commentaires plus anciens
HI there
sure this is super simple - but it's making my head hurt
I have a sigmoidal fit - which finds y for any x
But i want to fix y and find x (let's say y = 0.5)
a similar question is asked here https://uk.mathworks.com/matlabcentral/answers/416633-predict-y-values-from-x-values?s_tid=answers_rc1-1_p1_Topic
and one answer does it with fsolve(), but not sure how to make it work with my sigmoidal
fsigm = @(param,xval) param(1)+(param(2)-param(1))./(1+10.^((param(3)-xval)*param(4)));
param=[0 1 5 1]; % "min", "max", "x50", "slope"
x=0:0.1:10;
y=fsigm(param,x) + 0.1*randn(size(x));
plot(x, y)
%% --------i'm sure i should use something like---------
% x = fsolve(@(x)coeffs(1)*x+coeffs(2)-y_val,0)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!