| 查看: 4508 | 回复: 7 | ||
[求助]
MATLAB 中V4插值原理和计算步骤,急求!
|
| MATLAB 中V4插值原理和计算步骤,求大神详解! |
» 猜你喜欢
中国机械工业科学技术奖含金量,好获奖吗?
已经有1人回复
日内瓦国际发明展没有转化,只有论文能报吗?必须线下参加吗?
已经有0人回复
物理学I论文润色/翻译怎么收费?
已经有203人回复
想投稿的来!
已经有0人回复
2027博士申请
已经有3人回复
华中科技大学集成电路学院招2027年博士研究生
已经有0人回复
华中科技大学陈实教授招2027年博士研究生
已经有37人回复
求英文歌,谢谢您。
已经有1人回复
蔡鹏课题组招收优秀硕士/博士研究生
已经有11人回复
澳门大学 应用物理及材料工程研究院 潘晖教授课题组诚招博士后
已经有14人回复
» 本主题相关价值贴推荐,对您同样有帮助:
matlab 三次插值 求助!!!!!!!!!!!
已经有14人回复
求助用matlab 多元非线性拟合2
已经有21人回复
电机原理与设计的MATLAB分析
已经有140人回复
matlab插值法的一个问题
已经有6人回复
matlab可以进行曲线插值吗?
已经有3人回复
如何在MATLAB中插值求取中间截面(外轮廓线)
已经有4人回复
非线性数据拟合的数学原理!!!!!????
已经有30人回复
matlab 高维数组插值 矢量化 避免for循环
已经有5人回复
求Matlab插值程序
已经有4人回复
matlab多维插值原理是什么?
已经有5人回复
样条插值与样条拟合的区别
已经有5人回复
matlab用多元线性最小二乘法求解多元线性方程的问题
已经有11人回复
Matlab在地学中的应用
已经有24人回复
用matlab脚本绘制vasp中的能带图
已经有6人回复
vasp 过渡态计算 线性插值方法。
已经有8人回复
【资源】matlab与化学-作图,计算与数据处理 pdf格式(纳米盘/爱问)
已经有149人回复
【分享】推荐一本好书《精通MATLAB最优化计算》
已经有880人回复


2楼2014-12-24 00:39:11

3楼2014-12-24 16:38:22

4楼2014-12-24 23:21:26
|
从MATLAB中找出的源程序,直接不懂! >>type griddata function [xi,yi,zi] = gdatav4(x,y,z,xi,yi) %GDATAV4 MATLAB 4 GRIDDATA interpolation % Reference: David T. Sandwell, Biharmonic spline % interpolation of GEOS-3 and SEASAT altimeter % data, Geophysical Research Letters, 2, 139-142, % 1987. Describes interpolation using value or % gradient of value in any dimension. xy = x( + y(*sqrt(-1); % Determine distances between points d = xy(:,ones(1,length(xy))); d = abs(d - d.'); n = size(d,1); % Replace zeros along diagonal with ones (so these don't show up in the % find below or in the Green's function calculation). d(1:n+1:numel(d)) = ones(1,n); non = find(d == 0, 1); if ~isempty(non), % If we've made it to here, then some points aren't distinct. Remove % the non-distinct points by averaging. [r,c] = find(d == 0); k = find(r < c); r = r(k); c = c(k); % Extract unique (row,col) pairs v = (z(r) + z(c))/2; % Average non-distinct pairs rep = find(diff(c)==0); if ~isempty(rep), % More than two points need to be averaged. runs = find(diff(diff(c)==0)==1)+1; for i=1:length(runs), k = (c==c(runs(i))); % All the points in a run v(runs(i)) = mean(z([r(k);c(runs(i))])); % Average (again) end end z(r) = v; if ~isempty(rep), z(r(runs)) = v(runs); % Make sure average is in the dataset end % Now remove the extra points. z(c) = []; xy(c, = []; xy(:,c) = []; d(c, = []; d(:,c) = []; % Determine the non distinct points ndp = sort([r;c]); ndp(ndp(1:length(ndp)-1)==ndp(2:length(ndp))) = []; warning('MATLAB:griddata:NonDistinctPoints',['Averaged %d non-distinct ' ... 'points.\n Indices are: %s.'],length(ndp),num2str(ndp')) end % Determine weights for interpolation g = (d.^2) .* (log(d)-1); % Green's function. % Fixup value of Green's function along diagonal g(1:size(d,1)+1:numel(d)) = zeros(size(d,1),1); weights = g \ z(; [m,n] = size(xi); zi = zeros(size(xi)); jay = sqrt(-1); xy = xy.'; % Evaluate at requested points (xi,yi). Loop to save memory. for i=1:m for j=1:n d = abs(xi(i,j)+jay*yi(i,j) - xy); mask = find(d == 0); if ~isempty(mask), d(mask) = ones(length(mask),1); end g = (d.^2) .* (log(d)-1); % Green's function. % Value of Green's function at zero if ~isempty(mask), g(mask) = zeros(length(mask),1); end zi(i,j) = g * weights; end end if nargout<=1, xi = zi; end |

5楼2014-12-25 10:22:14

6楼2014-12-25 12:11:43

7楼2014-12-25 12:12:29

8楼2014-12-26 10:02:01









回复此楼