Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
how can I extract a fit parameter, that depends on the independent variable, as a vector of that variable? Thanks a lot!
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
y = ((coeff(1)./x)+(coeff(2)^2)./(x.^2))*(fitParameter); % but fitParameter also depends on vector x
7 comentarios
darova
el 3 de Mayo de 2020
What about tihs?
p = polyfit(X,Y,1);
Y1 = polyval(p,X);
plot(X,Y,'.r',X,Y1)
legend('data','fit')
Respuestas (1)
Image Analyst
el 3 de Mayo de 2020
Try this:
fitParameter = SomeFunctionOfX(x); % Returns a vector the same length as x.
term1 = coeff(1) ./ x;
term2 = coeff(2) ^ 2 ./ (x. ^ 2);
% Compute formula. Note: term1, term2, and fitParameter all depend on vector x.
y = (term1 + term2) .* fitParameter;
You, of course, have to define SomeFunctionOfX() since we don't know what it is.
2 comentarios
Image Analyst
el 3 de Mayo de 2020
What made fitParameter? Is it a scalar (one value for all x) or vector with one value for every value of x in hte x vector?
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!