could anyone help me to overcome the error in the following code
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
madhan ravi
2019-3-28
编辑:madhan ravi
2019-3-28
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 个评论
madhan ravi
2019-3-28
You have some problems in reading , read my answer once again THERE WAS NO SORTROWS() function mentioned there!!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!