필터 지우기
필터 지우기

could anyone help me to solve the issue in the following matrix

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2020년 2월 24일
답변: jaah navi 2020년 2월 24일
I ma having matrix A=[
44 0 0;
0 57 0;
0 1 48]
The sum(A) is 150.
Could anyone please help me how to make the matrix such that sum of each row of the matrix be 50 under the condition the diagonal of the matrix should contain the maximum number greater than 45 and the rest of the place can have the number ranging from 1 to 5.
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 2월 24일
Well you cannot for that matrix. The second row contains 57 so the minimum sum for the row cannot be less than 57 but you need it to be 50.
Walter Roberson
Walter Roberson 2020년 2월 24일
Are the entries restricted to integers?

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 24일
P = rand(3,1)*3+45;
Q = (50 - P - 1).*rand(3,1) + 1;
R = 50 - P - Q;
A = [P, Q, R] ;
Now circshift row 2 by 1 right and circshift row 3 by 2 right.

추가 답변 (1개)

jaah navi
jaah navi 2020년 2월 24일
the entries need not to be restricted.
The numbers can be changed with respect to the following conditions.
the diagonal of the matrix should contain the maximum number greater than 45 and the rest of the number can be in the remaining places of each row.
the sum of each row of the matrix should be 50.

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by