Hello everyone doing research in many places, I found the following matlab code and try to make a translation to mathematica, I share the notebook but the problem arises when comparing the graphs obtained in both programs since they are very different, I wonder if there is anyone in this community who can help me to find the solution to my problem. Thanks in advance and happy new year !
People who do not have Matlab would benefit at least from the picture of original graph you would like to reproduce. Can you add it to your post?
Briefly looked at your code.
At the bottom part of your code:
fielduno = # - fielduno[[1, 1]] & /@ fielduno;
{out, c2, c0} = rhod[{0, 0}, {0, 0}, R, 2*H];
fielduno =
fielduno +
KroneckerProduct[ty*RandomVariate[NormalDistribution[], n],
tx*RandomVariate[NormalDistribution[], m]]*Sqrt[2*c2];
after that the following will be enough:
data = Table[fielduno[[i, j]], {i, n/2}, {j, m/2}];
ListPlot3D[data, Mesh -> None, PlotTheme -> "Detailed",
ColorFunction -> ColorData["Rainbow"], DataRange -> {{0, 1}, {0, 1}},
RegionFunction -> Function[{x, y, z}, Norm[{x, y}] < 1]]
Jaebum Jung many thanks for helping me to solve my problem, also thank you to devote your time to find the bug in my code, thanks to your help I could see a beautiful graph.


