MATLAB Answers

Help with the interpolate function

27 views (last 30 days)
Shane
Shane on 15 Jul 2014
Answered: Shane on 15 Jul 2014
I have a vector of x-coordinates a=[64x1] and a vector of y coordinates b=[64x1]. I want to use interpolate to find the values at different points along the x-axis, which is vector c=[10x1], if that makes sense.
Right now im doing interp(a,b,c) and I get back an error that says.
Operands to the and && operators must be convertible to logical scalar values.
Error in interp (line 56) if l < 1 r < 1 cutoff <= 0 cutoff > 1
I looked at the user guide but it doesn't seem to make any sense.

  0 Comments

Sign in to comment.

Accepted Answer

Alfonso Nieto-Castanon
Alfonso Nieto-Castanon on 15 Jul 2014
Use interp1 instead of interp

  0 Comments

Sign in to comment.

More Answers (2)

Guilherme Coco Beltramini
Guilherme Coco Beltramini on 15 Jul 2014
The function you want is interp1 (with "1" in the end).

  0 Comments

Sign in to comment.


Shane
Shane on 15 Jul 2014
Cool thanks

  0 Comments

Sign in to comment.