You are on page 1of 2

function [r]=IntA6(x1,x2,x3,x4)

%interpolacion en tablas A6
load('tablasA6.mat','T','P')
switch x1
case 'T'
var1=x2
pos1=2
case 'P'
var1=x2
P1p=sum(var1./P==1)
pos1=1
case 'v'
var1=x2
pos1=3
case 'u'
var1=x2
pos1=4
case 'h'
var1=x2
pos1=5
case 's'
var1=x2
pos1=6
end
switch x3
case 'T'
var2=x4
pos2=2
case 'P'
var2=x4
P1p=sum(var2./P==1)
pos2=1
case 'v'
var2=x4
pos2=3
case 'u'
var2=x4
pos2=4
case 'h'
var2=x4
pos2=5
case 's'
var2=x4
pos2=6
end
if P1p == 1
Ta=T(:,:,find(var1./P==1))
if pos1==1
Tb=Ta(:,pos2-1)
if sum(var2./Tb==1)==1
find(var2./Tb==1)
r=[var1 Ta(find(var2./Tb==1),:)]
else
n1= sum(var2./Tb>1)
n2=sum(var2./Tb>1)+1
r= [var1 (((var2-Tb(n1))/(Tb(n2)-Tb(n1)))*(Ta(n2,:)-Ta(n1,:)))+Ta(n1
,:)]

end
end
end
end

You might also like