필터 지우기
필터 지우기

Can i convert a binary matrix to a function?

조회 수: 3 (최근 30일)
Maria
Maria 2022년 9월 27일
댓글: Maria 2022년 10월 7일
Hello everyone!
i have a binary matrix R(m*n), each row has multiple "1" , i want to optimize it in order to get only "1" in each row and no more than 3 "1" in each column. i want to user an optmizer but all of them need an optmization function. so can i return the matrix to a function in order to solve this problem?
thanks in advance
  댓글 수: 6
Torsten
Torsten 2022년 9월 28일
편집: Torsten 2022년 9월 28일
What kind of problem ?
As I said, there are of course matrices for which no solution exists. And the smaller you choose the possible number of ones per column, the greater the probability.
But if the solver says that a feasible solution can not be found, you can trust that your matrix doesn't permit a solution.
Maria
Maria 2022년 10월 7일
@Torsten okay! i got it , thank you very much for you help.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 9월 27일
Yes, you can return a matrix from the function. However, that would be considered multiple objectives, and you would need to use one of the multi-objective optimizers.
To use optimizers such as fmincon() or ga() your objective function needs to return a scalar (well, except as determined by any UseVectorized option that might be in effect.)
... which I already told you in your earlier question.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by