필터 지우기
필터 지우기

Problem with function output Problem with function output

조회 수: 1 (최근 30일)
Pietro Fiondella
Pietro Fiondella 2022년 7월 16일
답변: Torsten 2022년 7월 16일
I have this function that gives me as result a vector that has NaN element while i expect numerical values what i did wrong?
the input should be with different dimension
x= vector
n=number
function WCoeff = Coeff(x,n)
M=[1 2 3 4 5 6 7 8 9 10 11 12];
y=linspace(x(1),x(end),n*(numel(x)-1)+1);
WCoeff=interp1(M,x,y);
end

채택된 답변

Torsten
Torsten 2022년 7월 16일
y must be a vector with element between min M and max M.
This doesn't seem to be true in your case since you generate y in between min x and max x, I guess.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by