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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by