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) endend%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) endend
This is the error:
Error using griddedInterpolantInterpolation 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.
Best Answer