I have a matrix with 30*12 dimension. I just want to interpolate the vertical dimension and keep the row constant. How can I do that with interp1? It should be 1200*12. And is there any other function that does the interpolation with not just linearly?

 採用された回答

KSSV
KSSV 2018 年 1 月 7 日

1 投票

Have a look on imresize.

6 件のコメント

Seyed Sahand Mohammadi Ziabari
Seyed Sahand Mohammadi Ziabari 2018 年 1 月 7 日
I do not want just resize the matrix. I want to interpolate it! I did sth like this xi = 1:0.2:900; Data1 = interp1(Data,xi); Data1=Data1(1:1200,1:12); but that is not accurate interpolation.
Stephen23
Stephen23 2018 年 1 月 7 日
編集済み: Stephen23 2018 年 1 月 7 日
"but that is not accurate interpolation."
What is "accurate interpolation" ? What do you expect to get?
Seyed Sahand Mohammadi Ziabari
Seyed Sahand Mohammadi Ziabari 2018 年 1 月 7 日
As I understood Matlab uses linear interpolation. I just want to have a more complex interpolation like cubic formula or sth like that. I have to matrices that one of them is 1200*12 and the other one is 30*12. I want to interpolate this 30*12 in a way that its sum of squares of these two matrices become very low! Thanks, in advance.
Stephen23
Stephen23 2018 年 1 月 7 日
"As I understood Matlab uses linear interpolation."
When you read the interp1 help then you will learn about the different kinds of interpolation that MATLAB supports. Reading the documentation is much more reliable than guessing to know how MATLAB works.
Jan
Jan 2018 年 1 月 7 日
@Seyed: Images are resized by interpolating them.
"like cubic formula or sth like that" - please be specific. It is your turn to explain, what you want.
Seyed Sahand Mohammadi Ziabari
Seyed Sahand Mohammadi Ziabari 2018 年 1 月 11 日
Ok, got it. Thanks a lot, both of you Stephen Cobeldick and Jan Simon.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by