RANDSWAP

バージョン 1.0.0.0 (2.32 KB) 作成者: Jos (10584)
randomly swap elements of a matrix
ダウンロード: 3.7K
更新 2007/11/26

ライセンスの表示

For vectors, Y = RANDSWAP(X) randomly swaps the elements of X. For N-D matrices, RANDSWAP(X) randomly swaps the elements along the first non-singleton dimension of X.

RANDSWAP(X,DIM) randomly swaps the elements along the dimension DIM. For instance, RANDSWAP(X,1) randomly interchanges the rows of X.

Y = RANDSWAP(X,'partial') swaps the elements for each of the non-singleton dimensions of X separately. Rows are interchanged first, then columns, then planes, etc. In this case, elements that belong to the same row, column, ... stay together.

Y = RANDSWAP(X,'full') randomly swaps all the elements in X.

[Y, I, J] = RANDSWAP(...) return index matrices I and J so that Y = X(I) and X = Y(J).

X can be a numeric or a cell array.

Version 2.0 (nov 2007)

引用

Jos (10584) (2024). RANDSWAP (https://www.mathworks.com/matlabcentral/fileexchange/12621-randswap), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R13
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCreating and Concatenating Matrices についてさらに検索
謝辞

ヒントを得たファイル: shake

ヒントを与えたファイル: randone1

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

fixed serious bug with dimmode