interpolating row data in a matrix

1 回表示 (過去 30 日間)
Natalie
Natalie 2013 年 10 月 15 日
回答済み: Natalie 2013 年 10 月 18 日
I have a large set of data that I need to linearly interpolate evenly by a factor of 22. The way that the data is organised means that the each row of data needs to be interpolated instead of each column, how do I make it so that rows of data are interpolated instead of columns?

採用された回答

Natalie
Natalie 2013 年 10 月 18 日
Sat down with someone and worked it out together:
num_rows = length(a); num_columns = 22;
b = zeros(num_rows,num_columns); c = zeros(num_rows,num_columns);
for i = 1:num_rows
count = a(i,13);
int_c(i,:) = (0:1/(num_columns - 1):1)*c(i,count);
int_b(i,:) = interp1(b(i,1:count), b(i,1:count), new_thick(i,:),'spline');
end
end

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 10 月 15 日
newV = interp1(X, V.', newX) .';
  1 件のコメント
Natalie
Natalie 2013 年 10 月 16 日
Sorry, forgot to mention that there are a bunch of Nan values so this doesn't work

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


Youssef  Khmou
Youssef Khmou 2013 年 10 月 15 日
large data means down sampling?
If it is the other case, you can interpolate row by row as in this example :
r=randn(30);
for n=1:30
G(n,:)=interp(r(n,:),22);
end
  1 件のコメント
Natalie
Natalie 2013 年 10 月 16 日
Sorry what I meant by large data I meant large in size, about 1000 rows and 100 columns. I wish to interpolate the data along the rows not columns, so interpolate the data present in each column of a row. Also I forgot to mention that there is also the problem of a lot of Nan values

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by