help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indexing functions?


From: Doug Stewart
Subject: Re: Indexing functions?
Date: Mon, 9 Oct 2017 10:22:30 -0400



On Mon, Oct 9, 2017 at 9:58 AM, denizyazgac <address@hidden> wrote:
Okey;
I try to make an optimisation with using DE
I have a function which changes with two variable. One of them is frequency,
other one is resistance

for example:
func=@(x,f)  x*f

I have an experimental data of "func" in frequency domain and I try to back
calculate x.

So I have for example;
f=[100,200,300];
exp_data=[200,400,600] as an experimental results. And I try to find best x
which satisfies


error_array=@(x,f) abs(func(x,f(index))-exp_data(index))^2; %error function
for each frequency
sum_error=@(x,f) sum(error_array(x,f)) % I try to minimize that function

So I use sum_error for DE search.
I hope thats clear.




did you read 
https://www.gnu.org/software/octave/doc/v4.0.0/Minimizers.html

why not make a function that returns sum_error and then use one of the functions on that page?

function ret=plant(x,f)
...
ret=sum_error
end function



reply via email to

[Prev in Thread] Current Thread [Next in Thread]