Density plot in Matlab

前端 未结 1 1413
Happy的楠姐
Happy的楠姐 2021-01-27 19:12

What is the Matlab\'s comparable function to Mathematica\'s ListDensityPlot? For example

ListDensityPlot[Table[Sin[x y/100], {x, -50, 50}, {y, -50,          


        
1条回答
  •  走了就别回头了
    2021-01-27 19:36

    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));
    

    0 讨论(0)
提交回复
热议问题