Problem with function output Problem with function output

2 visualizaciones (últimos 30 días)
Pietro Fiondella
Pietro Fiondella el 16 de Jul. de 2022
Respondida: Torsten el 16 de Jul. de 2022
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

Respuesta aceptada

Torsten
Torsten el 16 de Jul. de 2022
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.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by