clcclearformat compactnmc = 1000theta_initial = 0% b = ones(2)
for i = 1:nmca = round (rand(1)-0.3)theta_new = a + theta_initialif theta_new(1,1) > theta_initial(1,1) theta_initial = theta_new plot(theta_new,cos(theta_new),'*')if theta_initial >= 90 breakendendend plot(theta_new,cos(theta_new),'*')
how i can correct for plotting theta_new and its cos(theta_new)
Best Answer