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