フィルターのクリア

Random data selection from a matrix

1 回表示 (過去 30 日間)
Tinkul
Tinkul 2014 年 3 月 8 日
コメント済み: Image Analyst 2014 年 3 月 8 日
How can i select 5 datasample from the matrix
Z=[43;-57;98;23;-13;243;-98;112;325;560]

採用された回答

Image Analyst
Image Analyst 2014 年 3 月 8 日
Try this:
Z=[43;-57;98;23;-13;243;-98;112;325;560]
elementsToExtract = randperm(numel(Z), 5)
z5 = Z(elementsToExtract)
  3 件のコメント
Image Analyst
Image Analyst 2014 年 3 月 8 日
You must have a really old version of MATLAB. What version/release do you have? You can extract the 5 yourself:
Z=[43;-57;98;23;-13;243;-98;112;325;560]
elementsToExtract = randperm(numel(Z))
z5 = Z(elementsToExtract(1:5))
Tinkul
Tinkul 2014 年 3 月 8 日
Thanx sir. Now its working...I have matlab 7.8.0(R2009a) version...

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by