From: Andy on 14 Jul 2010 16:38 > Am I missing something? Isn't this just: > a = b==(1:n); No. This would require b to be the same size as 1:n. Also, for clarity, I believe the OP switched a and b between the description and the code. At first, a was a big matrix. But since b is not otherwise described or initialized, I think we must assume b is that big matrix, and a is the temporary output of b==i for each i.
From: Jan Simon on 14 Jul 2010 18:49 Dear PL, > What I want is transforming this: > for i=1:n > a=(b==i); > (operations on a) > end > > into something similar like this: > (compute a(i)) > for i=1:n > (operations on a(i)) > end If b is big, "(compute a(i))" will consume a lot of memory. Therefore I assume, that this will not be faster, even if you create the a(i) in a Mex. Jan
First
|
Prev
|
Pages: 1 2 Prev: rotating only object in a plot Next: Displaying IPA phonetic fonts on a plot |