问题
What is the Matlab's comparable function to Mathematica's ListDensityPlot
? For example
ListDensityPlot[Table[Sin[x y/100], {x, -50, 50}, {y, -50, 50}],
DataRange -> {{-50, 50}, {-50, 50}}]
will produce
Thank you.
回答1:
Matlab is different than Mathematica in the sense of vectorized computations vs symbolic computation.
You could do what you'd like by defining a grid of spatial samples for x & y and then sample your function accordingly.
For example:
dx = 0.1;
dy = 0.1;
x = -50:dx:50;
y = -50:dy:50;
[xx, yy] = meshgrid(x,y);
imagesc(sin(xx.*yy/100));
来源:https://stackoverflow.com/questions/37380750/density-plot-in-matlab