Hi,
I have different datasets that I would like to fit together in order to create a general equation.
Yet I have fitted each dataset independently as : y_i=a_i + b_i * log10(x)
%% Example of one dataset
x= [1 10 100]';y= [165 145 124]';fo = fitoptions('Method','NonlinearLeastSquares',... 'Lower',[1],... 'Upper',[200],... 'StartPoint',[180 180]);ft = fittype('a + b*log10(x)','dependent',{'y'},'independent',{'x'},'coefficients',{'a','b'},'options',fo);myfit=fit(x(:),y(:),ft);plot(x,y, 'ko', 'LineWidth',1.5, 'MarkerSize',7)hold onplot(myfit, 'k--')
But now I would like to test this thing : y_i = a_i + b * log10(x) with a general b for all the dataset. So I need to fit this new model into my whole dataset to get an estimation of b that match with every dataset.
Does anyone as an idea on how to do this in matlab ?
Thank you very much for your help.
Best Answer