How can I minimize for b in the equation
f(b) = norm((b*a+c),2)
when b is a scalar and c, a are vectors (Nx1)?
I tried:
objective_fct = @(beta_min)(norm((b*a+c),2))
[beta_min,fval] = fminsearch(objective_fct,[-ones(6,1), ones(6,1)])
but that doesn't work...
Assuming ${\bf a}\neq 0$, the minimum of $f(b)$ is $||{\bf c}||^2 - {({\bf a}\cdot {\bf c})^2\over ||{\bf a}||^2}$. This is attained at $b = -({\bf a}\cdot{\bf c})/||{\bf a}||^2$.
Here are the steps: $$||b{\bf a} + {\bf c}||^2 = (b{\bf a}+{\bf c})\cdot (b{\bf a}+{\bf c}) = ||{\bf a}||^2 b^2 + 2({\bf a}\cdot{\bf c})b + ||{\bf c}||^2.$$ The right-hand side is quadratic in $b$ and (assuming ${\bf a}\neq 0$) concave up. Find the minimum by taking the derivative with respect to $b$ and setting it equal to zero: $$2||{\bf a}||^2b + 2{\bf a}\cdot{c} = 0 \quad \Rightarrow \quad b = -{({\bf a}\cdot{\bf c})\over ||{\bf a}||^2}\,.$$
Evaluating the quadratic at this value of $b$ gives the answer $||{\bf c}||^2 - {({\bf a}\cdot{\bf c})^2\over ||{\bf a}||^2}$ as above.
In other words, it would seem that you can just enter the formula for the minimum explicitly, without needing to call any optimization routine.