Hi!
I have an anonymous function:
ht = @(A1,A2,A3,....) ...
meaning that I don't know in advance how many variables Ai are included in the definition of ht. Then I need to minimise ht in respect of the variables Ai. For example, for 2 indipendent variables I get a result with:
ht2 = @(A)ht(A(1),A(2));A0 = [1,1];[res,fval] = fminunc(ht2,A0)
How can I define ht2 dinamically with a variable number of unknown Ai?
Thanks!
Best Answer