Hyperbolic Fitting using multiple data sets from each experiment.
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have many x values and correspinding y value data set from a experiment, I wish to model it as y = 1 / (a + b*x^c) o
The x values from each data set is different.
0 Commenti
Risposte (1)
chicken vector
il 24 Apr 2023
Modificato: chicken vector
il 24 Apr 2023
data = readmatrix('Model.xlsx');
x = data(:,1);
y = data(:,2);
x = x(~isnan(x));
y = y(~isnan(y));
% Credits @Star Strider
hyprb = @(b,x) 1./(b(1) + b(2).*x.^b(3));
NRCF = @(b) norm(y - hyprb(b,x));
B0 = [1; 1; 1];
B = fminsearch(NRCF, B0);
figure
hold on;
grid on;
plot(x, y, 'pg')
plot(x, hyprb(B,x), '-r')
text(0.7, 0.52, sprintf('y = 1/(%.4f %+.4f x ^{%.4f})', B))
Result:
0 Commenti
Vedere anche
Categorie
Scopri di più su Linear and Nonlinear Regression in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!