Having trouble with interp2 within a for loop
이전 댓글 표시
Hello, I'm having a little issue with my for loop using interp2:
%For enthalpy given the temperature and pressure
p1 = 20:0.03:200;
t1 = 5:1:500;
for i = 1:length(p1)
for j = 1:length(t1)
rho(i,j) = interp2(p1,t1,rho_ph)
end
end
%For density given the pressure and enthalpy
p2 = 500:1:1100;
t2 = 200;
for k = 1:length(p2)
for l = 1:length(t1)
h_pt(k,l) = interp2(p2,t2,h_pt)
end
end
This is the error:
Error using griddedInterpolant
Interpolation requires at least two sample points in each dimension.
Error in interp2/makegriddedinterp (line 214)
F = griddedInterpolant(varargin{:});
Error in interp2 (line 111)
F = makegriddedinterp({X,Y},V,method,extrap);
I'm not really understanding what is being asked.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Waveform Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!