randperm reports too many input arguments

Running the following command as listed in
but getting an error ....
EDU>> randperm(6,3) ??? Error using ==> randperm Too many input arguments.
Thanks!

 採用された回答

Wayne King
Wayne King 2013 年 1 月 8 日
編集済み: Wayne King 2013 年 1 月 8 日

2 投票

You are most likely using a release in which randperm() only supported 1 input argument. That syntax was only introduced in R2012a.
You can mimic that syntax in your release with
out = randperm(6);
out = out(1:3)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeShare and Distribute Software についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by