Help with the interpolate function

조회 수: 23 (최근 30일)
Shane
Shane 2014년 7월 15일
이동: Dyuman Joshi 2024년 1월 20일
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.

채택된 답변

Alfonso Nieto-Castanon
Alfonso Nieto-Castanon 2014년 7월 15일
Use interp1 instead of interp
  댓글 수: 1
Shane
Shane 2014년 7월 15일
이동: Dyuman Joshi 2024년 1월 20일
Cool thanks

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

추가 답변 (1개)

Guilherme Coco Beltramini
Guilherme Coco Beltramini 2014년 7월 15일
The function you want is interp1 (with "1" in the end).

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by