Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. allinputs = {[1 2] [2 3] [3 4] [5 6]}
  2. A = []
  3.  
  4. inputArray = inputBuilder(A,[],allinputs,1)
  5.  
  6. function inputArray = inputBuilder(A,currBuild, allInputs, currIdx)
  7.  
  8. if currIdx <= length(allInputs)
  9.  
  10. for i = 1:length(allInputs{currIdx})
  11. mybuild = [currBuild allInputs{currIdx}(i)];
  12. inputBuilder(A,mybuild,allInputs,currIdx + 1);
  13.  
  14. end
  15.  
  16. if currIdx == length(allInputs)
  17. A = [A mybuild];
  18.  
  19. %debug output
  20. mybuild
  21. end
  22.  
  23.  
  24. if currIdx == 1
  25. inputArray = A;
  26. end
  27.  
  28.  
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement