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
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.
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!