Fitting Data into a model

3 Ansichten (letzte 30 Tage)
Hussam Ibrahim
Hussam Ibrahim am 26 Apr. 2018
Beantwortet: Star Strider am 26 Apr. 2018
I have some fluorescence recovery data. I want to fit it to a 1-exp(-constant*time) model, then use that model to subtract it from my data values to study remaining oscillations. Can someone help me with this?
I tried looking in the Basic fitting toolbox in Matlab, but couldn't find what I wanted. Best,
  1 Kommentar
John D'Errico
John D'Errico am 26 Apr. 2018
Bearbeitet: John D'Errico am 26 Apr. 2018
Use the curvefitting toolbox. The basic fitting tools that you will find off the plot menus do not really offer much in the way of fitting tools. Or use the optimization toolbox. Or use the stats toolbox. If you have none of those toolboxes then get one of them. Whichever fits your probable usage most. Personally, I would not be without any of them.
I like the curve fitting toolbox because it is so easy to enter your model.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 26 Apr. 2018
I would do this:
fluor_fcn = @(b,t) 1 - exp(b.*t); % Model Function
t = linspace(0, 10, 25); % Create ‘t’
y = fluor_fcn(-1,t) + randn(size(t))*0.25; % Create ‘y’
B0 = 1; % Initial Parameter Estimate
B = fminsearch(@(b) norm(fluor_fcn(b,t) - y), B0); % Estimate Parameters
figure
plot(t, y, 'p')
hold on
plot(t, fluor_fcn(B,t), '-')
hold off
grid
Of course, use your own values for ‘t’ and ‘y’, and use an appropriate value for ‘B0’. These are all core MATLAB functions, so no extra Toolboxes are necessary.

Kategorien

Mehr zu Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by