First N largest elements from matrix with constraints - matlab

谁都会走 提交于 2020-01-16 00:51:28

问题


I am having a trouble with coding in matrix.

I have a matrix P with n x m dimensions.

I need to find the first largest N (less than n) elements from the P and flag them to 1.

Let the matrix be Y, where Y(i,j)=1 or 0

Constraint : max(sum(Y(i))=1 ; min(sum(Y(i))=0

Application - I have n number of customers list and m number of offers. P(i,j) is expected profit from i th customer with j th offer. I need to figure out a matrix Y (n x m) which gives me the maximum expected profit. Each customers can get maximum 1 offer (or 0) and there is a budget so that we can only make N offers.

来源:https://stackoverflow.com/questions/18032627/first-n-largest-elements-from-matrix-with-constraints-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!