Conversion Mathematica Wolfram to Matlab

8 ビュー (過去 30 日間)
Juan Angel
Juan Angel 2021 年 8 月 23 日
編集済み: Juan Angel 2021 年 8 月 23 日
Hello!. I'd like to ask for your help please. This is just a question from an Mathematica code, and I just want to know how I could convert it to the Matlab language, where dim=1000:
Code Mathematica:
initcond := Module[{scal}, Do[Nh[i] = 1/dim, {i, 1, dim}];
gdist = LogNormalDistribution[0, \[Sigma]];
cdfunction = CDF[gdist, y];
pdfunction = PDF[gdist, y];
inversecdf[z_] = y /. Solve[cdfunction == z, y][[1]];
Do[x[i] = inversecdf[(i - .5)/dim] , {i, 1, dim}];
scal = Sum[Nh[i] x[i], {i, 1, dim}];
Do[x[i] = x[i]/scal , {i, 1, dim}]]
Thank you very much ;)

回答 (0 件)

カテゴリ

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