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(|u_i - K - u_0a^{-bt_i}|)$$
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%.
Have you looked at
fminsearch? It can minimize a cost function over several parameters (just put them together in one vector). Here are examples.