フィルターのクリア

Surf plot: Data dimensions must agree.

4 ビュー (過去 30 日間)
Duncan Wright
Duncan Wright 2017 年 11 月 5 日
回答済み: Star Strider 2017 年 11 月 5 日
Can't for the life of me figure this out..
trying to plot the following:
surf(transect1.lon,transect1.lat,transect1.z,transect1.u)
They have the following dimensions:
size(transect1.lon) = 29 1
size(transect1.lat) = 29 1
size(transect1.z) = 29 30
size(transect1.u) = 29 30

採用された回答

Star Strider
Star Strider 2017 年 11 月 5 日
Either ‘transect1.lon’ or ‘transect1.lat’ has to be (30x1), or you have to remove one column from ‘transect1.z’ and ‘transect1.u’ so the dimensions match. (An option is to interpolate the matrices to make them both (29x29), or interpolate one of the vectors to (30x1).)
The surface plots only take one matrix argument, so you have to use hold to plot both in the same axes.
After you make sure the vectors and matrix dimensions match, see if this does what you want:
figure
surf(transect1.lon,transect1.lat,transect1.z)
hold on
surf(transect1.lon,transect1.lat,transect1.u)
hold off
grid on
NOTE I can’t run your code to test this, so this is UNTESTED CODE.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by