how to linearly interpolate 2D matrix at a point (x,y)

6 Ansichten (letzte 30 Tage)
Matlab_Student
Matlab_Student am 22 Mär. 2018
Bearbeitet: Jan am 26 Mär. 2018
X: x-coordinate values, Y: y-coordinate values. These correspond to Values as the 2D table. interpolate the value at (2.5,3.5) but my code doesn't work. receive error of wrong input arguments
interpolatedvalue = interp2(X,Y,Values,2.5,3.5);
  1 Kommentar
Akira Agata
Akira Agata am 26 Mär. 2018
X, Y and Values should be full grid matrix or grid vector. Please check these variables in your code and the following documentation page.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jan
Jan am 26 Mär. 2018
Bearbeitet: Jan am 26 Mär. 2018
Please post a copy of the complete error message and show us the inputs.
This works fine:
X = rand(4, 5);
interp2(1:5, 1:4, X, 2.5, 3.5)
% Not: 1:4, 1:5 !!!

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by