• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Matlab常用函数

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
1 : 
im2double : [0,255]---->[0,1]

2: grp2idx:
[G,GN] = grp2idx(S) creates an index vector G from the grouping variable S. The result G is a vector taking integer values from 1 up to the number K of distinct groups. GN is a cell array of strings representing group labels.
其实就是一个分类过程,G返回所有的分类索引,GN返回所有的分类。
例如:A = [1 2 3 4 5 6 7 8 9 5 6 1 4 3 2 7 8 9 5 6 2 1 4];
[G,GN] = grp2idx(A);
结果:
G\' = 1     2     3     4     5     6     7     8     9     5     6     1     4   3     2     7     8     9     5     6     2     1     4
GN\' =   \'1\'    \'2\'    \'3\'    \'4\'    \'5\'    \'6\'    \'7\'    \'8\'    \'9\'
即总共有1-9这9个分类,G中的值是A中对应坐标下的相应元素的分类。

3: strtok: Find token in string.
TOKEN = strtok(STR,DELIM) returns the first token delimited by one of the characters in DELIM. strtok ignores any leading delimiters.一般用来对字符串进行分割。
例子:
s = \'  This is a simple example.\';
       [token, remain] = strtok(s,\'.\')
结果:
token = This is a simple example
remain = .
即以.为分隔符对符串进行分割,注意只返回一个次,如果要进行多次处理,则要用循环来处理,比如:
rem = \'E:\Matlab\Recovering Occlusion Boundaries from a Single Image\';
tok = {};
while ~isempty(rem)
    [tok{end+1}, rem] = strtok(rem, \'\\');
end
结果:tok : 1 * 3 cell
tok{1} = ‘E\';
tok{2} = \'Matlab\'
tok{3} = \'Recovering Occlusion Boundaries from a Single Image\'

4: regionprops: Measure properties of image regions,用来度量图像区域属性,统计被标记区域的面积分布,显示区域总数,从而达到测量标注矩阵L中每一个标注区域的一系列属性的目的,调用规则为:
STATS = regionprops(L,properties)
L中不同的正整数元素对应不同的区域,例如:L中等于整数1的元素对应区域1;L中等于整数2的元素对应区域2;以此类推。
返回值STATS是一个长度为max(L(:))的结构数组,结构数组的相应域定义了每一个区域相应属性下的度量。
Properties可以是由逗号分割的字符串列表、包含字符 串的单元数组、单个字符串\'all\'或者\'basic\'。如果properties等于字符串\'all\',则表4.1中的度量数据都将被计算;如果properties等于字符串\'basic\',则属性:\'Area\',\'Centroid\'和\'BoundingBox\'将被计算。
简而言之,如果属性用\'Area\',则返回值STATS中的Area代表每一类的元素个数。

5: integral2
Numerically evaluate double integral

q = integral2(fun,xmin,xmax,ymin,ymax) approximates the integral of the function z = fun(x,y) over the planar region xmin ≤ x ≤ xmax and ymin(x) ≤ y ≤ ymax(x).

example

q = integral2(fun,xmin,xmax,ymin,ymax,Name,Valuespecifies additional options with one or moreName,Value pair arguments.

http://www.mathworks.com/help/matlab/ref/integral2.html#btdgcqq


6: quad2d

Numerically evaluate double integral, tiled method

q = quad2d(fun,a,b,c,d) approximates the integral of fun(x,y) over the planar region  and . fun is a function handle, c and d may each be a scalar or a function handle.

http://www.mathworks.com/help/matlab/ref/quad2d.html



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
1.1 Rust安装发布时间:2022-07-18
下一篇:
不用rustup,Windows下gnu版Rust安装与开发环境配置发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap