Manually interpolate a 2D array

조회 수: 1 (최근 30일)
Ilias Seferoglou
Ilias Seferoglou 2019년 11월 25일
댓글: Angelina Papathanasiou 2019년 11월 25일
Hello,
Basically I have a question on how to manually interpolate a 2D array:
Let's say I have a 80 x 100 array and want to make it into 100 x 120. I want to increase the size of my array, and interpolate the values of the initial array.
Can anyone help me with this matter?
Thanks alot

채택된 답변

Andrei Bobrov
Andrei Bobrov 2019년 11월 25일
a = rand(4,8);% Let a - your array
F = griddedInterpolant(a);
[i,j] = ndgrid(linspace(1,4,10),linspace(1,8,12)); % grid for new array 10 x 12
out = F(i,j); % new array
  댓글 수: 1
Angelina Papathanasiou
Angelina Papathanasiou 2019년 11월 25일
I had the same question but I have the constraint that I cannot use complex commands (griddedInterpolant(), ndgrid()). Is there a way of receiving the same answer without them?
1.Can I use meshgrid() instead of ndgrid()? Is there a simple way to do the same without gridderInterpolant(), using "first pricinples"?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by