Error using interp2, line226 and line126
古いコメントを表示
size of Pressure=82*1, temperature=1*601, density=600*81
---------------------------------------------------------------------------------------------------------------------
for i=drange(1:100)
P=101;
result1=zeros(100);
result1(i)=interp2(Pressure,temperature,density,P,temperature(i));
disp(result1(i))
end
--------------------------------------------------------------------------------------------------------------------------
Error using griddedInterpolant
Interpolation requires at least two sample points for each grid dimension.
F = makegriddedinterp({X, Y}, V, method,extrap);
how to slove this griddedInterpolantion error?
2 件のコメント
Chunru
2021 年 12 月 13 日
The sizes of data points are not compatible:
size of Pressure=82*1, temperature=1*601, density=600*81
density should be 601*82
Kinjal Vijaybhai Deputy
2021 年 12 月 13 日
編集済み: Kinjal Vijaybhai Deputy
2021 年 12 月 13 日
回答 (1 件)
KSSV
2021 年 12 月 13 日
You need to transpose the density matrix:
for i=drange(1:100)
P=101;
result1=zeros(100);
result1(i)=interp2(Pressure,temperature,density',P,temperature(i));
disp(result1(i))
end
カテゴリ
ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!