Need help regarding optimization
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
Hi, here's the operation I want to do
1. the following operations:
A=rand(10,2)*100;
B=rand(10,2)*100;
c=[ones(10,1)*80.5 ones(10,1)*89.27];
result=A-B;
result(~(A-c>=0)) = 0
2. the following optimization (wich i don't know how to do exept with a looop but I want something faster and more straight forward)
I want to do the sum of the variable"results" and get the maximum.In this case the result would be in the form of: 1x2
So clearly I want to find the "c" that maximise "result2":
result2=sum(result)
(in the previous example the "c" were 80.5 and 89.27
So the point is when we do
result=A-B;
result(~(A-c>=0)) = 0
Some "A-B" yield a negative results so I want to find the c that
optimize positively. Let's set the "c" as c1 and c2
the final optization is going to be in the following dimesnion:
c=[ones(4,1)*c1 ones(4,1)*c2];
Thank you in advance
Gimpy
7 commentaires
Gimpy
le 15 Août 2012
Gimpy
le 15 Août 2012
Please take the time to give just one good example that captures all of the salient features of your real problem. If you have 22000-by-18, make a specific example with 5(or 6,7 or 8)-by-3. Show exactly (give the numeric arrays) the inputs and the exact expected output(s) for your specific example.
Thanks.
Gimpy
le 15 Août 2012
Modifié(e) : Walter Roberson
le 15 Août 2012
Matt Fig
le 15 Août 2012
Where did the values of 37.1 and 50 come from?
Inputs --- A=[45;37;32;50], B=[17;100;200;10]
Outputs --- C = [37.01 50]
Is this correct? If so, please show the MATLAB for loop you say you have that gets this result.
Gimpy
le 15 Août 2012
Réponses (0)
Cette question est clôturée.
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!