フィルターのクリア

convert maple code into matlab

2 ビュー (過去 30 日間)
itendra k kumar
itendra k kumar 2022 年 7 月 13 日
回答済み: Harshit Gupta 2022 年 7 月 13 日
tau:=x->x^2+1;
plot(tau,0..1,discont=true);
N:=100000:# iterations
Digits:=50:
Nb:=200:#Number of boxes
M:=array(1..Nb):
for i from 1 to Nb do
M[i]:=0;od:
x0:=0:x1:=1:
ix:=x->min(floor(Nb*(x-x0)/(x1-x0))+1,Nb);
x:= x0+(x1-x0)*evalf(rand()/10^(12));# random initial point
for i from 1 to N do
x:=evalf(tau(x)) ;
if (x<x0 or x>x1) then x:=x0+(x1-x0)*evalf(rand()/10^(12));
fi;
k:=min(floor(Nb*(x-x0)/(x1-x0))+1,Nb):
M[k]:=M[k]+1:
od:
fM:=x->M[ix(x)];
plot(fM,x0..x1);

回答 (1 件)

Harshit Gupta
Harshit Gupta 2022 年 7 月 13 日
You might wanna look at the answers under this query: How do I translate code from Maple to MATLAB? - (mathworks.com)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by