I'm trying to interpolate off the table attached.
E = xlsread('Exhaust_Cp.xlsx')
m_dot_exhaust =[0.0168758667758187 0.0168286355030812 0.0168280643029830 0.0163466175171450]
T_avg_rankine =[871.065000000000 974.025000000000 1115.12700000000 1304.31600000000]
[x,y]=meshgrid(E(2:end,1),E(1,2:end))
z=[E(2:end,2:end)]
Vq=interp2(x,y,z,m_dot_exhaust(1),T_avg_rankine(1))
But I keep getting this error. Can anyone tell me how to resolve this?
Error using griddedInterpolant
The sample points arrays must have the same size as the sample values array.

4 件のコメント

KSSV
KSSV 2020 年 10 月 22 日
Try
Vq=interp2(x,y,z',m_dot_exhaust(1),T_avg_rankine(1)) ;
If not working shre your file.
Karthik Agnihotri
Karthik Agnihotri 2020 年 10 月 22 日
I'm getting NaN when I try that.
I've attached my file here @KSSV
KSSV
KSSV 2020 年 10 月 22 日
It is beacuse, your points are lying outside the given grid....it comes to extrapolation and the result cannot be trusted.
Karthik Agnihotri
Karthik Agnihotri 2020 年 10 月 22 日
Ok..how would you propose I go about interpolating any data from this table if I know the temperature and mass flow? Given that I have a new data set for mass flow rate. Please let me know if you have any suggestions. Thanks

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

 採用された回答

KSSV
KSSV 2020 年 10 月 22 日

0 投票

Vq=interp2(x,y,z',m_dot_exhaust(1),T_avg_rankine(1)) ;

2 件のコメント

KSSV
KSSV 2020 年 10 月 22 日
m_dot_exhaust =[0.0168758667758187 0.0168286355030812 0.0168280643029830 0.0163466175171450];
T_avg_rankine =[871.065000000000 974.025000000000 1115.12700000000 1304.31600000000];
[x,y]=meshgrid(E(2:end,1),E(1,2:end));
z=[E(2:end,2:end)];
Vq=interp2(X,Y,z',T_avg_rankine,m_dot_exhaust*1000)
From your given points T_avg_rankine is x-axis and m_dot_exhaust is y-axis. Check your units......if I multiply this by 1000, the points very much lie in the grid.
Karthik Agnihotri
Karthik Agnihotri 2020 年 10 月 22 日
Thanks for the help! I'll look into the data collected again

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Resizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by