How can I interpolate the 2-dimensional data

2 ビュー (過去 30 日間)
Raj V
Raj V 2017 年 11 月 22 日
回答済み: KL 2017 年 11 月 22 日
I have data like this
1 2 3 4 5
1 81 83 85 87 90
2 84 N 88 90 92
3 83 85 86 N 91
4 86 87 88 92 94
5 88 89 90 96 99
How can I interpolate values for N?

採用された回答

KL
KL 2017 年 11 月 22 日
something like this maybe,
a = [81 83 85 87 90
84 0 88 90 92
83 85 86 0 91
86 87 88 92 94
88 89 90 96 99];
a = a(:);
x = 1:numel(a);
xq = find(a==0);
x(a==0)=[];
a(a==0)=[];
interp1(x,a,xq)
ans =
84
91

その他の回答 (1 件)

John D'Errico
John D'Errico 2017 年 11 月 22 日
編集済み: John D'Errico 2017 年 11 月 22 日
1. Download inpaint_nans from the file exchange.
2. Substitute NaN for the elements indicated with an N.
3. Use inpaint_nans.

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by