From: Chan Chun K Chan on 4 Apr 2010 07:35 just found out how to pick all the combination with two loops. problem now is: suppose each combination goes through an operation and results in an array, how to store them in an indexed way?
From: Cagri on 4 Apr 2010 13:48 "Chan Chun K Chan" <asdf(a)yahoo.com> wrote in message <hp9th9$3ks$1(a)fred.mathworks.com>... > just found out how to pick all the combination with two loops. problem now is: suppose each combination goes through an operation and results in an array, how to store them in an indexed way? You can use 3-D arrays. For example, if each iteration results in an array and if you want to save them all: --------------------------------------- AllArrays = []; for i=1:1:n AllArrays(:,:,i) = theArray; end ---------------------------------------
From: Chan Chun K Chan on 5 Apr 2010 09:15 the 3d matrix seems to be banded with lots of zeros at the rim. is there a wise way to solve this or sequence the results in a 2d array instead?
From: us on 5 Apr 2010 09:23 "Chan Chun K Chan" <asdf(a)yahoo.com> wrote in message <hpcnos$n8b$1(a)fred.mathworks.com>... > the 3d matrix seems to be banded with lots of zeros at the rim. is there a wise way to solve this or sequence the results in a 2d array instead? a hint: help cell; us
From: Alan B on 5 Apr 2010 10:13 "Chan Chun K Chan" <asdf(a)yahoo.com> wrote in message <hp9oni$1mt$1(a)fred.mathworks.com>... > Thanks for the help so far. Is there a way to exhaust all possible combination? my goal is not to just stop at selecting 2 rows, but to try out all combination. It would also be great if no row is deleted during the process. Much appreciated. If you want to check all possible combinations, then why are you choosing pairs randomly? Just loop over all possible row-index pairs. Then you can use the loop variable as the index into your output array as well.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Threshold's calculation in wentropy Next: how to set folder for compression |