Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: a very time consumming code
Posted:
Sep 27, 2013 7:06 PM


dpb <none@non.net> wrote in message <l24f0q$adi$1@speranza.aioe.org>... > On 9/27/2013 10:27 AM, Amer wrote: > > > Since randi(s) returns a scalar and the result is only b that is passed > modified by that one point , there's no point in computing any of the > rest  the function as written is the same as > > function [res] = binCross(a,b,cr) > fx=randi(length(a)); > res(fx)=b(fx); > end > > Now, this may not be what was/is intended; can't tell thatonly what is > actually coded. >
Thank you so much for your response, but as you can see in the code, the vector res is first changed, then one point in the vector is put to the value of b in the same index to ensure that at least one point from be is taken.
In fact, the function computes the binomial cross over between vectors a and b.



