Be the first to rate this file! 13 downloads (last 30 days) File Size: 1.87 KB File ID: #25310

shuffle label

by Wolfgang Schwanghart

 

15 Sep 2009 (Updated 16 Sep 2009)

Code covered by the BSD License  

randomly relabel a label matrix

Download Now | Watch this File

File Information
Description

shufflelabel randomly changes the order of label values in a label matrix. Zeros and nans are ignored. The label matrix can be every numerical data type, char or a cell array of strings.
 
 
 Example
  
      L = kron([1 2 3;3 2 3],[1 1; 2 2])
  
  
      L =
  
           1 1 2 2 3 3
           2 2 4 4 6 6
           3 3 2 2 3 3
           6 6 4 4 6 6
  
      Ls = shufflelabel(L)
  
      Ls =
  
           3 3 6 6 1 1
           6 6 2 2 4 4
           1 1 6 6 1 1
           4 4 2 2 4 4

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files license.txt,
shufflelabel.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
16 Sep 2009

fixed helpblock, added a reset option

Tag Activity for this File
Tag Applied By Date/Time
image processing Wolfgang Schwanghart 15 Sep 2009 10:14:18
matrix manipulation Wolfgang Schwanghart 16 Sep 2009 11:05:47

Contact us at files@mathworks.com