Conversion Mathematica Wolfram to Matlab

8 visualizzazioni (ultimi 30 giorni)
Juan Angel
Juan Angel il 23 Ago 2021
Modificato: Juan Angel il 23 Ago 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 ;)

Risposte (0)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by