フィルターのクリア

I'm trying to obtain a value between two points of vectors plotted against each other using the interp1 method, but the vale keeps coming up with NaN? Any suggestions>

1 回表示 (過去 30 日間)
Basically says it all in the question, but the line of code is as follows:
cet_3=interp1(Engine_Speed,Engine_Torque,ces_3);
both the Engine_Speed and Engine_Torque vectors are 1x15 vectors, and the ces_3 already has a single vale of around 55, however the value of cet_3 keeps coming out as NaN.

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 12 月 7 日
cet_3 = interp1(Engine_Speed, Engine_Torque, ces_3, 'linear', 'extrap');
interp1() by default will only interpolate between min(Engine_Speed) and max(Engine_Speed) and will return NaN for other values. You need to tell it that it is okay to extrapolate for ces_3 values outside that range.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by