Info
此问题已关闭。 请重新打开它进行编辑或回答。
3D interpolation on a table
2 次查看(过去 30 天)
显示 更早的评论
First of all I want to thank everyone for the contribution to this forum.
Now my question goes. How can I do to be able to repeatedly interpolate with the code that I show below?. If I enter one value for x and y, it works correctly. but not when I try to do it for many values, g in my case is a 5041x7 matrix and Z11 is a matrix [1,8760] y Z22 is a matrix [1,8760]
Thanks a lot!!
I want to thank to Mr. Andrei Bobrov for his invaluable contribution to the forum. This code is your.
theta_l=atan(abs(tan (deltal).*cos (gamma1))); %longitudinal angle, in rad
theta_t=atan(tan (deltal).*abs(sin (gamma1))) %transversal angle, in rad
%disp(['Angulo longitudinal = ', num2str(theta_l), ' Angulo transversal = ', num2str(theta_t)])
Z1 = theta_l;
Z11 = reshape(Z1,[1,8760]);
Z2= theta_t;
Z22 = reshape(Z2,[1,8760]);
% code created by Andrei Bobrov
f = fopen('concentracion_txt.txt');
cc = textscan(f,'%f %f %f %f %f %f %f ','HeaderLines',2,'CollectOutput',1 );
fclose(f);
g = cc{:};
[A,B,C] = ndgrid(unique(g(:,1)),unique(g(:,2)),[1 25 50 75 100]);
n = size(A);
V = permute(reshape(g(:,3:end),n([2,1,3])),[2,1,3]);
F = griddedInterpolant(A,B,C,V);
concentracion = F(Z11,Z22,1)
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!