I am using a function that produces row vectors based on the RNG. Now I would like to repeat that function and put the rows into a matrix. I am currently using arrayfun, but that seems inneficient to me. Is there a way to use bsxfun to do this?(I included an example code to show what I mean)
Jos van den Berg
u=4;v=5;h=6;cell2mat(arrayfun(@(i) myfun(v,u,h) , 1:3, 'UniformOutput', false )')function y = myfun(v,u,h) y = [u*rand,v*rand,h*rand];end
Best Answer