This is how I have tried. But it does not seem to work. As fast as I run the function, MATLAB gets in Busy-mode and never returns. What am I doing wrong?
function amount = draw_rectangle(b)amount = b; for j =1:b; x = rand(1)*10; y = rand(1)*10; w = rand(1)*10; h = rand(1)*10; rectangle('Position', [x y w h]) hold on; end end
Best Answer