Interpolation of scattered earthquake data
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Afifah Shabrina
el 26 de Oct. de 2020
Comentada: Afifah Shabrina
el 28 de Oct. de 2020
Hello all, I am currently new on matlab and now i trying to write a mat lab code that can interpolate my scattered earthquake data and produce a file that contains a continuous grid of data. I have an hypoDD.reloc (double difference file). the 3rd column is Longitude (Lo), the 2nd column is Latitude (Lt) while the 4th is depth of earthquake. Please how can I go about this?. i've make a script like this :
clc;
clear all;
data = load('hypodd.reloc');
x = data(:,3);
y = data(:,2);
z = data(:,4);
[xi,yi] = meshgrid(119:1:120, -3.2:1:-2.2);
zi = griddata(x,y,z,xi,yi);
surf(xi,yi,zi);
colorbar
title('\fontsize{14}Pemodelan 3D Hiposenter Gempa Bumi Sesudah Relokasi');
legend('Sesudah Relokasi',1);
xlabel('Longitude')
ylabel('Latitude')
zlabel('Depth in Kilometers')
but, i have another issue with the depth because Zi must be a regresssion cant be matrix or vector data. please help me. T__________T
I look forward to your response.
1 comentario
Walter Roberson
el 26 de Oct. de 2020
Which release are you using? legend() has not permitted numeric entries for the positions for a fair number of years.
Respuesta aceptada
Walter Roberson
el 26 de Oct. de 2020
[xi,yi] = meshgrid(119:1:120, -3.2:1:-2.2);
>> [min(x),max(x),min(y),max(y)]
ans =
119.18147 119.609587 -3.132489 -2.392441
Your query points are x = 119 and 120 exactly, and y = -3.2 and -2.2 . However, 119 is before the x data starts and 120 is after the x data ends, and -3.2 is before the y data starts and -2.2 is after the y data ends.
Therefore your four query points are all outside of the range of data stored in the data file, and therefore the griddedInterpolant returns NaN for all four points. Therefore your surf() ends up blank.
Note: in order for a surf plot to appear, somewhere in the range of data, there has to be at least a 2 x 2 sub-matrix of finite data.
Más respuestas (0)
Ver también
Categorías
Más información sobre Earthquake Engineering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!