Need help regarding optimization
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
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 件のコメント
Gimpy
2012 年 8 月 15 日
Gimpy
2012 年 8 月 15 日
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
2012 年 8 月 15 日
編集済み: Walter Roberson
2012 年 8 月 15 日
Matt Fig
2012 年 8 月 15 日
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
2012 年 8 月 15 日
回答 (0 件)
この質問は閉じられています。
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!