What am I doing wrong with the function 'topkrows'

1 回表示 (過去 30 日間)
Systematically Neural
Systematically Neural 2017 年 12 月 6 日
回答済み: Razvan Carbunescu 2018 年 4 月 11 日
I am trying to use the function 'topkrows' - https://www.mathworks.com/help/matlab/ref/topkrows.html
Yet I cannot even do the example - when I try to use it I get the error "Undefined function 'topkrows' for input arguments type 'double'.
I also cannot find it when searching which topkrows.
Do I have a corrupted MATLAB download (using R2017a)
Any help would be great!

採用された回答

Image Analyst
Image Analyst 2017 年 12 月 6 日
It was introduced in R2016b (before your version). If you use which, you should see this:
>> which topkrows
C:\Program Files\MATLAB\R2017a\toolbox\matlab\datafun\topkrows.m
If you don't then call the Mathworks for fast and free friendly help because your installation is messed up, or you're not using R2017a like you thought.
  1 件のコメント
Systematically Neural
Systematically Neural 2017 年 12 月 6 日
Ok, I think there is an issue with 2017a's release. I will just go back to older version.
-Thanks

サインインしてコメントする。

その他の回答 (1 件)

Razvan Carbunescu
Razvan Carbunescu 2018 年 4 月 11 日
topkrows was initially introduced in R2016b as a function for tall arrays and tables only.
In R2017b the functionality was added for regular matrices and tables.
As a workaround in R2017a should use S = sortrows(A); and then index S(1:k,:);

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by