Fitting Data into a model
조회 수: 1 (최근 30일)
이전 댓글 표시
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
John D'Errico
2018년 4월 26일
편집: John D'Errico
2018년 4월 26일
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.
답변 (1개)
Star Strider
2018년 4월 26일
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!