How can I solve this error : Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.

11 次查看(过去 30 天)
n=input('donner le nombre de points') k=0; for i=1:n u1=rand;u2=rand; x=2*u1; y=2*u2; if(y<=[(4*x)/(x^2 +1)]-[x*(x-12)]) k=k+1; end end Surface = k/n;

回答(1 个)

Alan Stevens
Alan Stevens 2022-3-14
This works for me:
n=input('donner le nombre de points: ');
k=0;
for i=1:n
u1=rand;u2=rand;
x=2*u1;
y=2*u2;
if(y<=[(4*x)/(x^2 +1)]-[x*(x-12)])
k=k+1;
end
end
Surface = k/n;
disp(Surface)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by