make netcdf vectors same length for plot

1 回表示 (過去 30 日間)
Abigail Waring
Abigail Waring 2021 年 4 月 26 日
コメント済み: Star Strider 2021 年 4 月 29 日
I have 4 variables
T, Y, X, SST
SST is 3 dimensions, others are one dimension.
I get error code vectors must be same length
sst is 360x180x473
t is 473x1
x 180x1
y 360x1
im new to matlab so still learning any help will be appreciated thank you
  4 件のコメント
Star Strider
Star Strider 2021 年 4 月 26 日
The plot function is definitely going to have problems with a 3D matrix, although it can handle 2D matrices easily enough.
What specifically do you want to plot?
Abigail Waring
Abigail Waring 2021 年 4 月 26 日
I've managed to plot another similar to this file.
But i'm trying to plot SST over time at the lat and lon specified.

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2021 年 4 月 26 日
But i'm trying to plot SST over time at the lat and lon specified.
I assume those are the ‘x’ and ‘y’ values. If so, choose one in each, and plot it with respect to ‘t’.
Example —
SST = rand(360, 180, 473);
t = linspace(1, 24, 473).';
SSTplot = squeeze(SST(200,100,:));
figure
plot(t, SSTplot)
grid
I am not aware of any other way to do the plot.
  2 件のコメント
Abigail Waring
Abigail Waring 2021 年 4 月 29 日
Thank you
Star Strider
Star Strider 2021 年 4 月 29 日
My pleasure!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by