How to create contour maps in MATLAB?

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?

Antworten (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 24 Mai 2021

0 Stimmen

Hi,
Here is a nice matlab code for kriging method based interpolation.
Good luck.

5 Kommentare

Ivan Mich
Ivan Mich am 24 Mai 2021
ok and how could I plot this map? which command should I use?
Ivan Mich
Ivan Mich am 26 Mai 2021
How to plot the contours that created from this command?
Could you please help me?
Sulaymon Eshkabilov
Sulaymon Eshkabilov am 26 Mai 2021
Note that kriging method is a different meshing method that differs from MATLAB's meshgrid and is applicable for landscape mapping.
Once you get x, y, z computed, then you just use contour().
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?
You've made a small err. You should use this command:
contour(gridX, gridY, elevation)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Contour Plots finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 24 Mai 2021

Community Treasure Hunt

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

Start Hunting!

Translated by