Publisher review:swap - Randomly shuffles a binary matrix while keeping row and column sums the same as the original matrix. This function carries out a swap algorithm as described in Stone and Roberts (1990), Oecologia 85:74-79. The data matrix must be organized with sites (islands) as rows, and species as columns. The function only works with binary matrices (but can be easily modified to convert abundance matrices)."Swapping" randomly shuffles a binary matrix while keeping the row and column sums the same.To call the function, send the data matrix and the number of swaps you wish to have carried out: swap(matrix,1000). The function returns the shuffled matrix. For each swap, the function randomly identifies two rows and columns such that:[...0...1..;..........;...1...0..] and then switches (swaps) the 0's and 1's within the columns.Written by Brice X. Semmens (semmens@u.washington.edu), 03/26/03Comments and modifications/improvements welcome. Requirements: ยท MATLAB Release: R11.1
matlab swap is a Matlab script for Statistics and Probability scripts design by Brice Semmens.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
Operating system:Windows / Linux / Mac OS / BSD / Solaris