How do I interpolate a value from two sample vectors and two actual vectors?

8 ビュー (過去 30 日間)
Alan Gallagher
Alan Gallagher 2015 年 3 月 16 日
編集済み: Alan Gallagher 2015 年 3 月 16 日
I have a torque curve per rpm in two vectors:
rpm: 1250 1500 1750 2000 2500 3000 3500 4000 4500 5000 5500 6000
and torque: 194 259 325 383 420 420 413 410 395 383 343 275
So each vector is length 12. I also have real-time data in the form of two very long vectors giving rpm (rpm) and percent load (pctload).
I need to interpolate the actual, real-time torque value by multiplying the torque at that rpm(in the torque curve) by the percent load.
I have a feeling this can be done with the interp2 function, but am having trouble.
Any suggestions? clarification needed?
Thank you in advance.

採用された回答

Alan Gallagher
Alan Gallagher 2015 年 3 月 16 日
編集済み: Alan Gallagher 2015 年 3 月 16 日
Figured it out:
tableN= list of rpm's from 1250 to 6000
tabletorque: list of tested torques at the N values
rpm= real-time rpms
pctload= real-time percent load
real_time_torque=interp1(tableN,tabletorque,rpm).*pctload;

その他の回答 (1 件)

Adam
Adam 2015 年 3 月 16 日
>> g = griddedInterpolant( rpm, torque );
>> g( 1777 )
ans =
331.264
should do the trick. There are numerous interpolation methods that will probably work too - interp1 probably, but your interpolation is 1d not 2d unless I am misunderstanding the problem.
The value coming from the griddedInterpolant function g above is your interpolated RPM which you can then match to your pctload.
  1 件のコメント
Alan Gallagher
Alan Gallagher 2015 年 3 月 16 日
Thanks Adam,
This was correct too, however, interp1 allowed me to create a vector of these values.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by