Вы находитесь на странице: 1из 2

b

>> ezcontour('x.^2 -y.^2')


>> ezcontourf('x.^2 -y.^2')

a
x = linspace(-5,5);
>> x = linspace(-10,10);
>> y = linspace(-10,10);
>> [x,y]=meshgrid(x,y);
>> z= x.^2 - y.^2

2
x = linspace(-5,5);
x = linspace(-10,10);
y = linspace(-10,10);
[x,y]=meshgrid(1:2:20);
quiver (x,y, y+sin (2*pi*x/10), x+sin (2*pi*y/10))

mesh(sqrt((abs(y+sin (2*pi*x/10))).^2+(abs(x+sin (2*pi*y/10))).^2))

x = linspace(-5,5);
y = linspace(-5,5);
[x,y]=meshgrid(x,y);
u=y+sin(2*pi*x/10);
v=x+sin(2*pi*y/10);
quiver (x(1:4:end, 1:4:end),y(1:4:end, 1:4:end), u(1:4:end, 1:4:end),v(1:4:end,
1:4:end));

mesh(sqrt(abs(u).^2+abs(v).^2))

ezcontour('sqrt(abs(y+sin(2*pi*x/10)).^2+abs(x+sin(2*pi*y/10)).^2)')

ezcontourf('sqrt(abs(y+sin(2*pi*x/10)).^2+abs(x+sin(2*pi*y/10)).^2)')
>> ezcontour('sqrt(abs(y+sin(2*pi*x/10)).^2+abs(x+sin(2*pi*y/10)).^2)')
>> mesh(x,y,sqrt((abs(y+sin (2*pi*x/10))).^2+(abs(x+sin (2*pi*y/10))).^2))
>> quiver (x(1:4:end, 1:4:end),y(1:4:end, 1:4:end), u(1:4:end, 1:4:end),v(1:4:end,
1:4:end))

ezcontourf('sqrt(abs(y+sin(2*pi*x/10)).^2+abs(x+sin(2*pi*y/10)).^2)')
>> hold on
>> quiver (x(1:4:end, 1:4:end),y(1:4:end, 1:4:end), u(1:4:end, 1:4:end),v(1:4:end,
1:4:end))

syms x y
>> f=x.^2-y.^2

f =

x^2 - y^2

>> g = gradient(f, [x,y])

g =

2*x
-2*y

[X, Y] = meshgrid(-1:1:1,-1:1:1);
G1 = subs(g(1), [x y], {X,Y});
G2 = subs(g(2), [x y], {X,Y});
quiver(X, Y, G1, G2)

ezcontour('x.^2-y.^2', [-1,1]);
>> hold on
>> quiver(X, Y, G1, G2)

>> syms x y z
>> divergence([y+sin(2*pi*x/10), x+sin(2*pi*y/10), 0], [x, y, z])

ans =

(pi*cos((pi*x)/5))/5 + (pi*cos((pi*y)/5))/5

>> syms x y z
>> curl([y+sin(2*pi*x/10), x+sin(2*pi*y/10), 0], [x, y, z])

ans =

0
0
0

Вам также может понравиться