finding optimum solution
Ältere Kommentare anzeigen
Hi everyone,
I would apprechiate help with the following matter I have the following vectors A,D,B,C,E (each size 50,1) and calculate T=-A.*((B+x)-C)+D.*E; The goal is to find constant x so that sum(T)==0. I tried fminsearch, but didn't figure out how to make it work. I would be greatful for any help. Thanks.
2 Kommentare
Andrew Newell
am 29 Mär. 2011
If cumsum(T)==0, then isn't T==0? Or do you mean sum(T)==0?
Cora
am 29 Mär. 2011
Akzeptierte Antwort
Weitere Antworten (1)
Andrew Newell
am 29 Mär. 2011
As defined, your problem has an infinite number of solutions. You can expand your expression to get
T=-A.*x+D.*E-A.*B+A.*C;
Thus, for any vector T,
x = (D.*E-A.*B+A.*C-T)./A;
so you could choose any components for T so that sum(T)==0 and solve this equation.
1 Kommentar
Cora
am 30 Mär. 2011
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!