5 views (last 30 days)

darova
on 19 Feb 2020

Here is what i tried. I didn't use disp_down, only east and north

A = xlsread('coseis.xlsx');

x = A(:,1);

y = A(:,2);

u = A(:,3);

v = A(:,4);

X = reshape(x,[51 51]);

Y = reshape(y,[51 51]);

U = reshape(u,[51 51]);

V = reshape(v,[51 51]);

quiver(X,Y,U,V,5,'r')

xs = linspace(min(x),max(x),10);

ys = xs*0;

streamline(X',Y',U',V',[xs xs],[ys+102 ys+106])

darova
on 24 Feb 2020

I used griddata to reduce/interpolate data

You previously had 51x51 grid. I changed it to 20x20

Use N number to change density of grid

A = xlsread('coseis.xlsx');

x = A(:,1);

y = A(:,2);

u = A(:,3);

v = A(:,4);

N = 20; % number of points in each direction you want

x1 = linspace(min(x),max(x),N);

y1 = linspace(min(y),max(y),N);

[X,Y] = meshgrid(x1,y1); % new mesh for X,Y (reduced)

U = griddata(x,y,u,X,Y);

V = griddata(x,y,v,X,Y);

% U = reshape(u,[51 51]);

% V = reshape(v,[51 51]);

quiver(X,Y,U,V,3,'r')

xs = linspace(min(x),max(x),10);

ys = xs*0;

streamline(X,Y,U,V,[xs xs],[ys+102 ys+106])

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 3 Comments

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/505558-draw-this-type-of-figure-from-given-data-the-data-contains-lat-long-disp-north-east-down-and-other#comment_797630

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/505558-draw-this-type-of-figure-from-given-data-the-data-contains-lat-long-disp-north-east-down-and-other#comment_797630

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/505558-draw-this-type-of-figure-from-given-data-the-data-contains-lat-long-disp-north-east-down-and-other#comment_797652

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/505558-draw-this-type-of-figure-from-given-data-the-data-contains-lat-long-disp-north-east-down-and-other#comment_797652

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/505558-draw-this-type-of-figure-from-given-data-the-data-contains-lat-long-disp-north-east-down-and-other#comment_799687

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/505558-draw-this-type-of-figure-from-given-data-the-data-contains-lat-long-disp-north-east-down-and-other#comment_799687

Sign in to comment.