ferret_incident = data.FerretIncident;
ferret_lung = data.FerretLungPressure;
human_incident = data.PMHSIncidentPressure;
human_lung = data.PMHSLungPressure;
nhp_incident = data.NHPIncident;
nhp_lung = data.NHPLungPressure;
normalized_ferret_lung = ferret_lung ./ ferret_incident;
normalized_human_lung = human_lung ./ human_incident;
normalized_nhp_lung = nhp_lung ./ nhp_incident;
model = @(b, x) b(1) * x.^2 + b(2) * x + b(3);
opts = fitoptions('Method', 'NonlinearLeastSquares', 'StartPoint', [1, 1, 1]);
fitType = fittype('b1*x^2 + b2*x + b3', 'independent', 'x', 'coefficients', {'b1', 'b2', 'b3'});
[fitresult_ferret, gof_ferret] = fit(normalized_ferret_lung, normalized_human_lung, fitType, opts);
[fitresult_nhp, gof_nhp] = fit(normalized_nhp_lung, normalized_human_lung, fitType, opts);
predicted_human_from_ferret = model(coeffvalues(fitresult_ferret), normalized_ferret_lung);
predicted_human_from_nhp = model(coeffvalues(fitresult_nhp), normalized_nhp_lung);
plot(normalized_ferret_lung, normalized_human_lung, 'o', normalized_ferret_lung, predicted_human_from_ferret, '-');
title('Ferret to Human Data');
legend('Actual Human Data', 'Predicted Human Data');
xlabel('Normalized Ferret Lung Pressure');
ylabel('Normalized Human Lung Pressure');
plot(normalized_nhp_lung, normalized_human_lung, 'o', normalized_nhp_lung, predicted_human_from_nhp, 'o');
title('NHP to Human Data');
legend('Actual Human Data', 'Predicted Human Data');
xlabel('Normalized NHP Lung Pressure');
ylabel('Normalized Human Lung Pressure');