2013年1月20日

MATLAB——scatter的简单应用

摘要: scatter可用于描绘散点图。1.scatter(X,Y)X和Y是数据向量,以X中数据为横坐标,以Y中数据位纵坐标描绘散点图,点的形状默认使用圈。例子:X = [1:10];Y = X + rand(size(X));scatter(X, Y)得到:2.scatter(...,'filled')描绘实心点。例:3.scatter3(x,y,z)描绘三维图像。例子: 阅读全文

posted @ 2013-01-20 15:57 铁树银花 阅读(890) 评论(0) 推荐(0) 编辑

MATLAB获取随机数——rand

摘要: rand 可用于获得均匀分布的伪随机数。1.R = rand(N) 返回一个N*N的矩阵,其中的元素是来自(0,1)的随机数。例>> rand(3)ans = 0.8147 0.9134 0.2785 0.9058 0.6324 0.5469 0.1270 0.0975 0.95752.rand(M,N)or rand([M,N])返回一个M-by-N的矩阵,其中的元素是来自于(0,1)的随机数。3.rand(SIZE(A))返回与矩阵A具有相同规模的矩阵,矩阵中元素是来自于(0,1)的随机数。例A = [1,2;2,3];rand(size(A))得到ans = 0.5472 0 阅读全文

posted @ 2013-01-20 15:41 铁树银花 阅读(838) 评论(0) 推荐(0) 编辑

MATLAB矩阵的合成。

摘要: 以下大写字母均表示矩阵。1.C = [A,B]表示将矩阵A和B水平合成为矩阵C。例1:有指令:>> A = [1:3];>> B = [4:5];>> C = [A,B];矩阵A为A = 1 2 3矩阵B为B = 4 5合成C为C = 1 2 3 4 5例2:有指令>> A = [1,2;3,4];>> B = [3,4;5,6];>> C = [A,B];其中A = 1 2 3 4B = 3 4 5 6C = 1 2 3 4 3 4 5 62.C = [A;B]将矩阵A和B垂直合成为矩阵C例1:>> A = 阅读全文

posted @ 2013-01-20 12:02 铁树银花 阅读(716) 评论(0) 推荐(0) 编辑

MATLAB产生连续均匀分布的随机数组——unifrnd

摘要: unifrnd可以创建随机的连续均匀分布的数组。1.R = unifrnd(A,B)returns an array of random numbers chosen from the continuous uniform distribution on the interval from A to B. The size of R is the common size of A and B if both are arrays. If either parameter is a scalar, the size of R is the size of the otherparameter.这 阅读全文

posted @ 2013-01-20 11:37 铁树银花 阅读(2698) 评论(0) 推荐(0) 编辑

MATLAB实现频数表——hist的使用

摘要: 借助命令hist,matlab可以通过两个方式实现频数表。1.[f, xout] = hist(X)将数据向量X的取值范围均分为10个区间,统计频数,返回频数向量f和区间中点行向量xout.例1.执行指令>> X = [1, 1.2, 1.3, 2, 3, 3.2, 3.5, 4, 4.5, 5, 6];>> [f, xout] = hist(X)得到f = 3 1 0 1 2 1 1 1 0 1xout = 1.2500 1.7500 2.2500 2.7500 3.2500 3.7500 4.2500 4.7500 5.2500 5.75002.[f, xout] 阅读全文

posted @ 2013-01-20 10:23 铁树银花 阅读(3571) 评论(0) 推荐(0) 编辑

MATLAB实现频数直方图——hist的使用

摘要: "hist" is short for "Histogram(直方图、柱状图)"。1.N = hist(Y)bins the elements of Y into 10 equally spaced containersand returns the number of elements in each container. If Y is a matrix, hist works down the columns.(将向量Y的元素平均分到十个等间隔的容器中,并且返回每个容器的元素个数。如果Y是一个矩阵,hist指令逐列元素操作。Y为向量的情形见例1和2 阅读全文

posted @ 2013-01-20 10:14 铁树银花 阅读(5812) 评论(0) 推荐(0) 编辑

MATLAB——linspace

摘要: linspace用于产生等差数列。1.linspace(x, y)产生一个有100个元素的行向量,其中的元素在区间[x, y]中等间隔分布。如linspace(1,10)产生:Columns 1 through 9 1.0000 1.0909 1.1818 1.2727 1.3636 1.4545 1.5455 1.6364 1.7273 Columns 10 through 18 1.8182 1.9091 2.0000 2.0909 2.1818 2.2727 2.3636 2.4545 2.5455 Columns 19 through 27 2.6364 2.7273 2.8182 2 阅读全文

posted @ 2013-01-20 08:55 铁树银花 阅读(1211) 评论(0) 推荐(0) 编辑

导航