From: ben alex on 11 May 2010 09:28 Hello, I have 4 vectors A B C D of 100 x 1 matrix of data each. I'm trying to pair them up in loop in unique combinations. ie. A = rand(100,1); B = rand(100,1); C = rand(100,1); D = rand(100,1); pair = 2; for x = 2 combo1 = [A B]; combo2 = [A C]; combo3 = [A D]; combo4 = [B C]; combo5 = [B D]; combo6 = [C D]; end As you can all see, I'm doing this manually. Is there a way to code a logic so this gets done in a loop and also a condition so that [A B] won't get repeated as [B A] since thats essentially the same pairwise. Thanks, ben
From: Matt J on 11 May 2010 10:16 help NCHOOSEK
|
Pages: 1 Prev: Simulations of Silicon Waveguide Next: rectangular matrix |