From: Edgar Galvan on
Hi all,

I'm new to Matlab so please bear with me.

I am trying to optimize a utility function, function X=Util(C,D,E,Y,HS,LS,x,Ngt), where the inputs are vectors. I also have a bunch of constraints.

I've used fmincon before but only for functions with a single vector as an input like:

[x,fval]=fmincon(@(x)2*x(1)^2+x(2),[1 1],A,b,Aeq,beq)

Can fmincon handle more than one vector, if so how?

Thanks in advance
From: John D'Errico on
"Edgar Galvan" <dekuf409(a)aol.com> wrote in message <hvsca9$lai$1(a)fred.mathworks.com>...
> Hi all,
>
> I'm new to Matlab so please bear with me.
>
> I am trying to optimize a utility function, function X=Util(C,D,E,Y,HS,LS,x,Ngt), where the inputs are vectors. I also have a bunch of constraints.
>
> I've used fmincon before but only for functions with a single vector as an input like:
>
> [x,fval]=fmincon(@(x)2*x(1)^2+x(2),[1 1],A,b,Aeq,beq)
>
> Can fmincon handle more than one vector, if so how?
>
> Thanks in advance

No, fmincon cannot handle more than one vector.

However, can YOU take multiple vectors, and combine
them into one? Later on, can you separate these vectors
(of known length) and break them into the original
vectors? (YES.)

So what is the problem?

John
From: Edgar Galvan on

None I guess, thanks!