Created
April 2, 2015 11:16
-
-
Save Longlius/dc60bf3cbff51713af86 to your computer and use it in GitHub Desktop.
Cartesian product bullshit in Matlab for Ryan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xbuilder = cell(1, 27); | |
for x = 1:3 | |
for y = 1:3 | |
for z = 1:3 | |
i = (((x - 1) * 9) + ((y - 1) * 3) + (z - 1)) + 1; | |
Xbuilder{1,i} = [x 0 0; 0 y 0; 0 0 z;]; | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment