matlab2014a中help与参考页翻译 Tutorials-matrices and arrays- Array Creation

来源:互联网 发布:手机一键截屏软件下载 编辑:程序博客网 时间:2024/06/08 07:05

镇场诗:慈心积善融学习,技术誓为大家学。善心速造多好事,前人栽树后乘凉。我今于此写经验,愿见文者得启发。
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Tutorials-matrices and arrays- Array Creation


Array Creation 创建矩阵

To create an array with four e

lements in a single row, separate the elements with either a comma (,) or a space.

为了创建一个四元素单行数组,各个元素要么用逗号,要么用空格隔开。


a = [1 2 3 4]
returns 返回
a =

     1     2     3     4

This type of array is a row vector. 这是一个行向量


To create a matrix that has multiple rows, separate the rows with semicolons.
为了创建一个多行的矩阵,分离每一行用分号。
a = [1 2 3; 4 5 6; 7 8 10]
a =

     1     2     3
     4     5     6
     7     8    10
Another way to create a matrix is to use a function, such as ones, zeros, or rand. For example, create a 5-by-1 column vector of zeros.

创建一个矩阵的其他方式就是用函数,比如ones, zeros, 或者rand。比如,我们要创建一个五行一列的全0列向量。


z = zeros(5,1)
z =

     0
     0
     0
     0
     0




///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
感恩帮助过我的人。博客的精髓在技术部分,更在镇场一诗。
我是一个新手,翻译还有许多不完善的地方,请您看翻译的时候多多思考。
MATLAB是一个优秀的软件,值得学习。如果您有一些不会的知识,咱们可以相互讨论。
如果您认为翻译可以有改进的地方,有错误的地方,请留下评论,我会处理的。
注:如果我的博文无意中侵犯了您的权益,请告知。看到您的告知后,我将及时作出处理。
0 0