Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
589 B
0
Indexable
Never
% Given data points
t = [10, 11, 12, 14, 15];
y = [21.34, 20.68, 20.05, 18.87, 18.30];

% Define the radioactive decay model function
decay_model = @(params, t) params(1) * exp(-0.02 * t) + params(2) * exp(-0.05 * t);

% Initial guess for parameters M_A and M_B
initial_guess = [1, 1];

% Use lsqcurvefit to find the least-squares solution
params_fit = lsqcurvefit(decay_model, initial_guess, t, y);

% Extract M_A and M_B from the fitted parameters
M_A = params_fit(1);
M_B = params_fit(2);

% Display the results
fprintf('Estimated M_A: %f\n', M_A);
fprintf('Estimated M_B: %f\n', M_B);
Leave a Comment