【 MATLAB 】gallery 中的 uniformdata

版权声明:本博客内容来自于个人学习过程中的总结,参考了互联网以及书本、论文等上的内容,仅供学习交流使用,如有侵权,请联系我会重写!转载请注明地址! https://blog.csdn.net/Reborn_Lee/article/details/83061964

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');

猜你喜欢

转载自blog.csdn.net/Reborn_Lee/article/details/83061964
今日推荐