我要加入 登录
声振论坛 返回首页

huright的个人空间 http://home.vibunion.com/?19755 [收藏] [复制] [分享] [RSS]

日志

三维散乱数据处理

已有 361 次阅读2007-5-21 21:14 |个人分类:关注学习

1.函数meshgridy中行的每一行复制x,同样也对x中列的每一列复制y。这种方向与前面语句相一致,即y向下改变其列,而x横跨改变其行。

2.

x=???  %  statement defining vector of x-axis values

       y=???  %  statement defining vector of y-axis values

       nx=length(x);  %  length of x is no. of rows in Z

       ny=length(y);  %  length of y is no. of columns  in Z

 

       Z=zeros(nx,ny);  %  initialize Z matrix for speed

      

       for r=1:nx

              {preliminary commands}

              Z(r,:)={a function of y and x(r) defining r-th row of Z}

       end

3.

x=???  %  statement defining vector of x-axis values

       y=???  %  statement defining vector of y-axis values

       nx=length(x);  %  length of x is no. of rows in Z

       ny=length(y);  %  length of y is no. of columns  in Z

 

       Z=zeros(nx,ny);  %  initialize Z matrix for speed

 

       for r=1:nx

              for c=1:ny

                     {preliminary commands}

                     Z(r,c)={a function of y(c) and x(r) defining Z(r,c)}

              end

       end

4.在有些情况下,两个变量的标量函数的值,如z=f(x,y),不能简单地算出。这是因为要么xy的值是非均匀间隔的(最坏时是随机分布),要么是用了不同的坐标系,比如非长方形的网格。出现这些情况时,MATLAB中的函数griddata就用来产生经插值后的均匀间隔数据以作图。首先考虑前面的例子。假设要求较高的分辨率,但我们不想重新计算函数来得到新值。

发表评论 评论 (1 个评论)

回复 zongdao 2007-7-4 16:13
嗯。我现在也正用griddata呢。

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 我要加入

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-20 07:13 , Processed in 0.035573 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部