"James Tursa" wrote in message <firstname.lastname@example.org>... > "Pag Max" wrote in message <email@example.com>... > > Is there a smarter or shorter way to do this than what I have done? (Of course withot loop!!). I am thinking there is something repetitive in my solution > > c is tiled in third dimension as many times as elements in b and then each tile is scaled by corresponding element in b. > > > > c=[1 2 3;4 5 6]; > > b=[1 2 3 4 5]; > > a=bsxfun(@times,repmat(c,[1 1 numel(b)]),reshape(b,[1 1 numel(b)])); > > Why repmat the c matrix? E.g., > > a=bsxfun(@times,c,reshape(b,[1 1 numel(b)])); > > TMW seems to be dropping posts, so I will risk repeating an earlier post. My MTIMESX can also do this calculation, but will likely only benefit if the array sizes are large. What are the actual array sizes you are working with? > > James Tursa
Thanks I get it. Yes this post appeared much after I submitted. So did not check any responses. I understand repmat was a repeatation. Yes I am dealing with very large array sizes. Will like to know if MTIMESX can be a smarter solution.