电磁场与电磁波——标量场及其梯度
程序员文章站
2022-03-18 21:51:40
...
电磁场与电磁波——标量场及其梯度
标量场(a)及其梯度的图形化
// MATLAB程序:
[X,Y] = meshgrid(-10:3:10);
Z = 10+X;
[DX,DY] = gradient(Z,3,3);
figure
contour(X,Y,Z)
hold on
quiver(X,Y,DX,DY)
hold off
An highlighted block
var foo = 'bar';
标量场(a)及其梯度的图形化表示:
标量场(b)其梯度的图形化
// MATLAB程序:P337b.m
[X,Y] = meshgrid(-10:3:10);
Z = X.*X;
[DX,DY] = gradient(Z,3,3);
figure
contour(X,Y,Z)
hold on
quiver(X,Y,DX,DY)
hold off
(b)的场分布和梯度图示:
标量场(c)及其梯度的图形化
// MATLAB程序:
[X,Y] = meshgrid(-10:1:10);
Z = 100+X.*Y;
[DX,DY] = gradient(Z,1,1);
figure
contour(X,Y,Z)
hold on
quiver(X,Y,DX,DY)
hold off
(c)的场分布和梯度图示:
推荐阅读