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 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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.
Risposte (1)
Walter Roberson
il 7 Dic 2015
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 Commenti
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!