How to create contour maps in MATLAB?

9 次查看(过去 30 天)
Hello
I have a question about a code
I would like to create contour maps in matlab with kriging method. I use meshgrid and griddata commands to create contour maps, but the above commands use triangulation method. I would like to use kriging method?
Is there a way to make it? Could you please help me?

回答(1 个)

Sulaymon Eshkabilov
Hi,
Here is a nice matlab code for kriging method based interpolation.
Good luck.
  5 个评论
Ivan Mich
Ivan Mich 2021-5-26
My code is
clc
clear
filename1= 'data.csv'
[d1,tex]= xlsread(filename1);
VAL =d1(:,1);
lat=d1(:,2);
lon=d1(:,3);
[elevation,gridX,gridY] = kriging(lon,lat,VAL)
contour(([elevation,gridX,gridY]))
and command window shows me :
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
Error in Untitled (line 35)
contour(([elevation,gridX,gridY]))
elevation is 200X200 double
gridX 1x 200 double
gridY 1x 200 double
Where am I wrong?
Sulaymon Eshkabilov
You've made a small err. You should use this command:
contour(gridX, gridY, elevation)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by