Hyperbolic Fitting using multiple data sets from each experiment.

2 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

chicken vector
chicken vector il 24 Apr 2023
Modificato: chicken vector il 24 Apr 2023
Please try to use the forum next time, as your answer was just a simple search away.
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:

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!

Translated by