Creating m by 2 matrix

조회 수: 5 (최근 30일)
Kojo Anim
Kojo Anim 2021년 9월 25일
댓글: Image Analyst 2021년 9월 25일
For the following coding problem you may now use the functions rref, size, zeros, and eye. Produce a Matlab function that takes an m n matrix A and produces an m 2 matrix M, where the kth row of the matrix M is [x y] where x is the largest entry in row k of A, and y is the column containing the the entry x. If multiple columns of row k contain the entry x, then y should be the leftmost column of row k with entry x.
  댓글 수: 4
Image Analyst
Image Analyst 2021년 9월 25일
"I can demonstrate with examples what the problem seeks to achieve." How? Pen and paper? Not code?

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

답변 (1개)

David Hill
David Hill 2021년 9월 25일
[a,b]=max(A,[],2);
M=[a,b];
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 9월 25일
note that this is obviously a homework question
David Hill
David Hill 2021년 9월 25일
That is why I didn't really answer the question.

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by