3

我真的停滞不前——认为这很容易。

我有 3 个数组 - 纬度、经度和温度,

在每个数据点或位置我想绘制温度

作为等高线图。

所以在(45,123)温度= 73

值样本:

 Latitude = [45 45 67 34 31 54 60 63 61];

 Longitude = [123 121 117 114 132 119 122 135 134];

 Temp = [73 75 75 73 67 72 82 78 80];
4

2 回答 2

1

有什么困难?只需使用轮廓功能。 http://www.mathworks.com/help/techdoc/ref/contour.html

contour(Latitude,Longitude,Temp)
于 2012-08-21T00:27:36.423 回答
1

迟到总比不到好!如果有人在寻找工作代码应该知道该contour函数有点棘手,您必须使用矩阵来显示等高线图。所以:

n = length(Latitude);
[X, Y] = meshgrid(linspace(min(Latitude), max(Latitude), n), linspace(min(Longitude), max(Longitude), n));
Z = griddata(Latitude, Longitude, Temp, X, Y);
contour(X, Y, Z);

如果您更喜欢填充图,请使用:

contourf(X, Y, Z);

如果你想在 a 上绘制你的情节worldmap

contourfm(X, Y, Z);

希望它可以帮助某人。

于 2019-01-17T19:09:18.983 回答