필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Question about the 'interp2' function

조회 수: 1 (최근 30일)
yogesh
yogesh 2013년 11월 23일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
I have a question about the 'interp2' function in MATLAB. It looks like this :
Zi = interp2(X,Y,Z,Xi,Yi). Let's say X is (m x 1) and Y is (n x 1). Now in general, Z would have (m x n) data points. But they can be arranged in either or (m x n) or (n x m) format. From my understanding, 'interp2' seems to expect Z to be in (n x m) and gives an error if we had specified Z as (m x n).
For example, let's say Y is (3 x 1) and X is (2 x 1), then 'interp2' expects Z to be (3 x 2) and gives an error if it is (2 x 3). Is my observation correct? Also, is there a specific reason why it is so?
Thanks yogesh

답변 (1개)

Walter Roberson
Walter Roberson 2013년 11월 23일
You should be phasing out that kind of code.
If you provide X and Y grids instead of vectors you can use whichever orientation you prefer.
Why choose that order? Because some order had to be chosen.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by