y = reshape(Strength_MPa,3,[]);
y_min = y(1,end/2+1:end);
y_mid = y(2,end/2+1:end);
y_max = y(3,end/2+1:end);
[xData, yData] = prepareCurveData( x, y_mid );
ft = fittype( 'power2' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.StartPoint = [2450.16071129496 -0.0464507882616668 0.160697077002396];
[fitresult, gof] = fit( xData, yData, ft, opts );
x_fit = linspace(1,1600,100);
y_fit = fitresult(x_fit);
plot(x_fit,y_fit,'--r','DisplayName','Strength Fit')
xlabel( 'x', 'Interpreter', 'none' );
ylabel( 'y_mid', 'Interpreter', 'none' );
errorbar(x,y_mid,y_mid-y_min,y_max-y_mid, ...
'DisplayName','Strength')
ylabel('Strength [MPa]','Color',[ 0 0 0 ])
[xData, yData] = prepareCurveData( x, y );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.StartPoint = [58.0338200304954 0.00142172529592695];
[fitresult, gof] = fit( xData, yData, ft, opts );
x_fit = linspace(1,1600,100);
y_fit = fitresult(x_fit);
plot(x_fit,y_fit,':b','DisplayName','Grain Size Fit')
xlabel( 'x', 'Interpreter', 'none' );
ylabel( 'y', 'Interpreter', 'none' );
plot(Grainsize_nm(:,1),Grainsize_nm(:,2),'-ro', ...
'MarkerFaceColor','r', ...
'DisplayName','Grain Size')
ylabel('Grainsize [nm]','Color',[ 0 0 0 ])