Borrar filtros
Borrar filtros

could anyone help me to overcome the error in the following code

3 visualizaciones (últimos 30 días)
jaah navi
jaah navi el 28 de Mzo. de 2019
Comentada: madhan ravi el 28 de Mzo. de 2019
Code
A=rand(3,8)
C=max(A,[],2)
D=maxk(C,3)
When i run the code i am getting error stating Undefined function or variable 'maxk'.
could anyone please help me to overcome it.

Respuestas (1)

madhan ravi
madhan ravi el 28 de Mzo. de 2019
Editada: madhan ravi el 28 de Mzo. de 2019
maxk() was introduced in 2017b so if you are using version prior to it use:
1) sort() row wise in descending order.
2) Just extract the first three columns from it.
  2 comentarios
jaah navi
jaah navi el 28 de Mzo. de 2019
When i use sortrows command all the rows are getting sorted.
what i need is i need to sort the numbers present in each row but not sorting the order of rows.
Could you please help me on this.
madhan ravi
madhan ravi el 28 de Mzo. de 2019
You have some problems in reading , read my answer once again THERE WAS NO SORTROWS() function mentioned there!!

Iniciar sesión para comentar.

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by