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 comentarios

Kojo Anim
Kojo Anim el 25 de Sept. de 2021
Yes it is,
I can demonstrate with examples what the problem seeks to achieve. My challenge now if how to write that in codes. I am a novice and I will appreciate any form of asssistance to understand the code that will work for me.
function M=rowMaxs(A)
end
Image Analyst
Image Analyst el 25 de Sept. de 2021
"I can demonstrate with examples what the problem seeks to achieve." How? Pen and paper? Not code?

Iniciar sesión para comentar.

Respuestas (1)

David Hill
David Hill el 25 de Sept. de 2021

0 votos

[a,b]=max(A,[],2);
M=[a,b];

2 comentarios

Walter Roberson
Walter Roberson el 25 de Sept. de 2021
note that this is obviously a homework question
David Hill
David Hill el 25 de Sept. de 2021
That is why I didn't really answer the question.

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 25 de Sept. de 2021

Comentada:

el 25 de Sept. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by