Matlab 中的密度图
Density plot in Matlab
Matlab 与 Mathematica 相比的功能是什么 ListDensityPlot
?例如
ListDensityPlot[Table[Sin[x y/100], {x, -50, 50}, {y, -50, 50}],
DataRange -> {{-50, 50}, {-50, 50}}]
会产生
谢谢。
在向量化计算与符号计算的意义上,Matlab 不同于 Mathematica。
您可以为 x 和 y 定义一个空间样本网格,然后相应地对您的函数进行采样。
例如:
dx = 0.1;
dy = 0.1;
x = -50:dx:50;
y = -50:dy:50;
[xx, yy] = meshgrid(x,y);
imagesc(sin(xx.*yy/100));
Matlab 与 Mathematica 相比的功能是什么 ListDensityPlot
?例如
ListDensityPlot[Table[Sin[x y/100], {x, -50, 50}, {y, -50, 50}],
DataRange -> {{-50, 50}, {-50, 50}}]
会产生
谢谢。
在向量化计算与符号计算的意义上,Matlab 不同于 Mathematica。
您可以为 x 和 y 定义一个空间样本网格,然后相应地对您的函数进行采样。
例如:
dx = 0.1;
dy = 0.1;
x = -50:dx:50;
y = -50:dy:50;
[xx, yy] = meshgrid(x,y);
imagesc(sin(xx.*yy/100));