【 MATLAB 】gallery 中的 uniformdata

举报
李锐博恩 发表于 2021/07/15 05:38:54 2021/07/15
【摘要】 Test matrices gallery是一个产生测试矩阵的函数。下面讲解其语法以及用法描述,数据手册上的英文很简单,耐心看,我就不一一翻译了。 Syntax [A,B,C,...] = gallery(matname,P1,P2,...) [A,B,C,...] = gallery(matname,P1,P2,...,classname) gallery(3) ...

Test matrices

gallery是一个产生测试矩阵的函数。下面讲解其语法以及用法描述,数据手册上的英文很简单,耐心看,我就不一一翻译了。



Syntax

[A,B,C,...] = gallery(matname,P1,P2,...)
[A,B,C,...] = gallery(matname,P1,P2,...,classname)
gallery(3)
gallery(5)



Description

[A,B,C,...] = gallery(matname,P1,P2,...) returns the test matrices specified by matname. The matname input is the name of a matrix family selected from the table below. P1,P2,... are input parameters required by the individual matrix family. The number of optional parameters P1,P2,... used in the calling syntax varies from matrix to matrix. The exact calling syntaxes are detailed in the individual matrix descriptions below.

[A,B,C,...] = gallery(matname,P1,P2,...) 

这种语法格式,matname代表的是矩阵族的名称,例如本文要重点突出的uniformdata,产生的矩阵将是一个元素符合均匀分布的矩阵。P1,P2,...是各个矩阵族所需的输入参数。它定义了需要产生的矩阵的维度等。具体要看各个具体的矩阵族。


[A,B,C,...] = gallery(matname,P1,P2,...,classname) produces a matrix of class classname. The classname input must be either 'single' or 'double' (unless matname is'integerdata', in which case 'int8''int16''int32''uint8''uint16', and 'uint32' are also allowed). If classname is not specified, then the class of the matrix is determined from those arguments among P1,P2,... that do not specify dimensions or select an option. If any of these arguments is of class single then the matrix is single; otherwise the matrix is double.

[A,B,C,...] = gallery(matname,P1,P2,...,classname)

这种语法格式与第一种不同在于它有一个类名,用于定义数据的类,是single还是double。如果未指定classname,则根据P1,P2,......中未指定维度或选择选项的参数确定矩阵的类。如果这些参数中的任何一个是single类,则矩阵是single的; 否则矩阵是double的。


gallery(3) is a badly conditioned 3-by-3 matrix and gallery(5) is an interesting eigenvalue problem.

gallery(3)是一个条件差的3乘3矩阵,而gallery(5)是一个有趣的特征值问题。

The gallery holds over fifty different test matrix functions useful for testing algorithms and other purposes.

该库拥有50多种不同的测试矩阵函数,可用于测试算法和其他目的。



uniformdata — Array of arbitrary data from standard uniform distribution

A = gallery('uniformdata',[m,n,...],j) returns an m-by-n-by-... array A. The values of A are a random sample from the standard uniform distribution. j must be an integer value in the interval [0, 2^32-1]. Calling gallery('uniformdata', ...) with different values of j will return different arrays. Repeated calls to gallery('uniformdata',...) with the same size vector and j inputs will always return the same array.

In any call to gallery('uniformdata', ...) you can substitute individual inputs m,n,... for the size vector input [m,n,...]. For example, gallery('uniformdata',[1,2,3,4],5) is equivalent to gallery('uniformdata',1,2,3,4,5).

[A,B,...] = gallery('uniformdata',[m,n,...],j) returns multiple m-by-n-by-... arrays AB, ..., containing different values.

A = gallery('uniformdata',[m,n,...],j, classname) produces a matrix of class classnameclassname must be either 'single' or 'double'.

Generate the arbitrary 6-by-4 matrix of data from the uniform distribution on [0, 1] corresponding to j = 2.

x = gallery('uniformdata', [6, 4], 2);

 

 

Generate the arbitrary 1-by-2-by-3 single array of data from the uniform distribution on [0, 1] corresponding to j = 17.

y = gallery('uniformdata', 1, 2, 3, 17, 'single');

文章来源: reborn.blog.csdn.net,作者:李锐博恩,版权归原作者所有,如需转载,请联系作者。

原文链接:reborn.blog.csdn.net/article/details/83061964

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。