# This is a simple problem. Normaly I use two for-loops in GNU Octave to find the parameter a an

This is a simple problem. Normaly I use two for-loops in GNU Octave to find the parameter $a$ and $b$ and $K$.
The cost function I'm going to minimize is:
$V=\sum _{i=0}^{N}\left(|{u}_{i}-K-{u}_{0}{a}^{-b{t}_{i}}|\right)$
Where ${u}_{i}$ is a vector for measurement and ${t}_{i}$ is also a measured vector. ${u}_{0}$ is known so only $a$,$b$,$K$ is unknow.
Is there any other way to minimize $V$ instead of using three for-loops in GNU Octave?
In my case, two-variables can solve the problem too. The $K$ is just a correction factor. Not necessary to 100%.
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

postojahob
Have you looked at fminsearch? It can minimize a cost function over several parameters (just put them together in one vector).