%% We define the parameters and their values
n = 2;
b0 = 1;
K = -3;
eta = 1;

%% We define and plot the function to minimize
% We define a function to minimize
f = @(x) eta .* (x-b0).^n + K;
% We choose the range of values of x we want to look at
xRange = 0:.1:9;

close all
plot(xRange, f(xRange));
xlabel('x');
ylabel('f(x) = (x-b)^n + K');

%% We look for the minimum of f using fminsearch, starting from x=4
% and store in into xMin
xMin = fminsearch(f, 4);

%% We represent the minimum of f on the plot
hold on
plot(xMin, f(xMin), '.', 'MarkerSize', 20);