Again sharing my problems, sharing information with some friends one of them i shared this code in Matlab and try to do the same in Mathematica, i found myself with the unpleasant surprise that don’t know if the function ArrayResample do the same as the function interp2 Matlab,the code is short and my attempt to do the same in Mathematica is the following.
terre = ConstantArray[0, {2, 2}];
c = 0.1;
For[i = 1, i < 7, i++,
ele = Length[terre];
nLon = 2*ele - 1;
(*paso B*)terre = ArrayResample[terre, nLon];
subsquares = ConstantArray[1, Dimensions[terre]];
subsquares[[1 ;; Length[subsquares] ;; 2,
1 ;; Length[subsquares] ;; 2]] = 0;
vals = Position[subsquares, 1];
randmap = c*RandomVariate[NormalDistribution[], Dimensions[terre]];
rval = Extract[randmap, vals];
camb = Thread[vals -> rval];
terre = ReplacePart[terre, camb];
c = c/2;
]
The attached file in Matlab for you tell me some idea of why the chart does not i get equal.
Here is the graphics obteined with mathematica
ListPlot3D[terre, Mesh -> None, Boxed -> False, Axes -> False,
ColorFunction -> ColorData["Rainbow"], DataRange -> {{0, 1}, {0, 1}},
Background -> GrayLevel[.1]]
But you should see a graph like this, here is the graph.






