Conversion Mathematica Wolfram to Matlab
8 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!