my code won't run or publish
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
m = 2;
n = 1;
hold on
for i = 1:100000
q = 3*rand(1);
if q < 1
m = m/2;
n = n/2;
elseif q < 2
m = m/2;
n = (300+n)/2;
else
m = (300+m)/2;
n = (300+n)/2;
end
plot(m,n,'b')
end
hold off
0 comentarios
Respuestas (1)
David Hill
el 6 de Jun. de 2020
m = 2;
n = 1;
for i = 1:100000
q = 3*rand(1);
if q < 1
m = m/2;
n = n/2;
elseif q < 2
m = m/2;
n = (300+n)/2;
else
m = (300+m)/2;
n = (300+n)/2;
end
mm(i)=m;
nn(i)=n;
end
scatter(mm,nn,'filled','MarkerFaceColor','b','SizeData',1);
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!