Conversion Mathematica Wolfram to Matlab

8 views (last 30 days)
Juan Angel
Juan Angel on 23 Aug 2021
Edited: Juan Angel on 23 Aug 2021
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 ;)

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!