How to interpolate gridded data for contourf?

1 回表示 (過去 30 日間)
Chua Wei Yi
Chua Wei Yi 2022 年 10 月 9 日
回答済み: Chunru 2022 年 10 月 9 日
Hi all,
I am trying to generate a contourf image. I have a gridded data with x y z in a table. However I have a bunch of NaNs which results in considerable amount of gap in my contourf image. How can I interpolate the data bilinearly such that the adjacent known z numbers are linearly interpolated all the way through the NaNs. Below is my code for reference. And some pictures of my data and image plotted.
data = CirManualDia15H19V0S2;
y = data(2:end,1);
x = data(1,2:end);
Data = data(2:end,2:end);
Y = table2array(y);
X = table2array(x);
Data = table2array(Data);
contourf(X,Y,Data,90,'LineStyle','none');
set(gca, 'YDir','reverse');
set(gca, 'XDir','reverse')

回答 (1 件)

Chunru
Chunru 2022 年 10 月 9 日
doc fillmissing

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by