You are on page 1of 7

compass(2,2)

Z = randn(20,20);
compass(Z)

Z = eig(randn(20,20));
compass(Z)

FEATHER:

% Coordenadas cartesianas:
x = 2;
y = 3;
feather(x,y); % Plot velocity vectors

% Coordenadas polares:
theta = 45*pi/180;
r = 2.5;

[u,v] = pol2cart(theta,r);
%Transform polar or cylindrical coordinates to Cartesian
figure
feather(u,v);
theta = (-90:10:90)*pi/180;
r = 2*ones(size(theta));
[u,v] = pol2cart(theta,r);
figure
feather(u,v);

APLICACIÓN A CAMPOS VECTORIALES

Super:

https://www.youtube.com/watch?v=EYyI42Wp9OI

Introduction to Vector Fields


https://www.youtube.com/watch?v=pwiSCrlP98o
QUIVER:
A quiver plot displays velocity vectors as arrows with components (u,v) at the points (x,y).
For example, the first vector is defined by components u(1),v(1) and is displayed at the point x(1),y(1).
quiver(x,y,u,v) plots vectors as arrows at the coordinates specified in each corresponding pair of elements
in x and y. The matrices x, y, u, and v must all be the same size and contain corresponding position and
velocity components. However, x and y can also be vectors, as explained in the next section. By default,
the arrows are scaled to just not overlap, but you can scale them to be longer or shorter if you want.
quiver(u,v) draws vectors specified by u and v at equally spaced points in the x-y plane.

EJEMPLO 1: se entiende fácilmente

Use quiver to display an arrow at each data point in x and y such that the arrow direction and length
represent the corresponding values in u and v.
[x,y] = meshgrid(0:0.2:2,0:0.2:2);
u = cos(x).*y;
v = sin(x).*y;

figure
quiver(x,y,u,v)
EJEMPLO 2:

Plot the gradient of the function .


[X,Y] = meshgrid(-2:.2:2);
Z = X.*exp(-X.^2 - Y.^2);
[DX,DY] = gradient(Z,.2,.2);

figure
contour(X,Y,Z)
hold on
quiver(X,Y,DX,DY)
hold off

EJEMPLO 3:

Plot the surface normals of the function .

[X,Y] = meshgrid(-2:0.25:2,-1:0.2:1);
Z = X.* exp(-X.^2 - Y.^2);
[U,V,W] = surfnorm(X,Y,Z);

figure
quiver3(X,Y,Z,U,V,W,0.5)

hold on
surf(X,Y,Z)
view(-35,45)
axis([-2 2 -1 1 -.6 .6])
hold off
SUPER -----Serie de 3 videos:
https://www.youtube.com/watch?v=qOcFJKQPZfo
https://www.youtube.com/watch?v=Cxc7ihZWq5o
https://www.youtube.com/watch?v=vvzTEbp9lrc

https://www.youtube.com/watch?v=XmEeerT6o1g
Electric Fields & Potential

SCALAR FIELDS:
https://www.youtube.com/watch?v=lm0v2Ovi2iM

You might also like