Draw this type of figure from given data.the data contains lat long disp(north,east,down) and other quantities but i need figure only for the displacement simillar to the attached figure

3 comentarios

Please show your attempts. WHat have you tried?
Really I am not getting how to proceed for this.
Can you just reduce my data to half that means delete the rows with value 30.06:.12:33 in first column and 102.06:.16:106 in the second column.

Iniciar sesión para comentar.

 Respuesta aceptada

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])

11 comentarios

I tried this but its showing index exceed matrix dimensions in line 8,I want to delete certain rows in first column and second column.please modify this as per my requirment
[num1,txt1,raw1] = xlsread('year_10');
[num,txt,raw] = xlsread('coseis');
k=30.12:0.06:33;
k=k';
p=102.16:0.08:106;
p=p';
for i=1:51
ind=find(num(:,1)==k(i,1));
num(ind,:)=[];
end
for i=1:51
ind=find(num(:,2)==p(i,1));
num(ind,:)=[];
end
for i=1:51
ind=find(num1(:,1)==k(i,1));
num1(ind,:)=[];
end
for i=1:51
ind=find(num1(:,2)==p(i,1));
num1(ind,:)=[];
end
subplot(1,2,1);
quiver(num(:,2),num(:,1),num(:,3),num(:,4),2);
ylabel("Latitude");
xlabel("Longitude");
title("co-seismic");
subplot(1,2,2);
quiver(num1(:,2),num1(:,1),num1(:,3),num1(:,4),2);
ylabel("Latitude");
xlabel("Longitude");
title("post-seismic(10yr)");
I don't understand. What are you trying to do here?
  • I want to delete certain rows in first column and second column
  • Remove 50% of data point
Please be more specific: What points are you trying to remove?
My plot is getting very dense I want to get a clear plot
So I need to plot half of the present data
What about interpolation (interp2)?
No need of interp only need to reduce the data
interp2 can reduce the data
Can you please do this for me
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])

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Seismology en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Feb. de 2020

Comentada:

el 24 de Feb. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by