zero函数的用法(matlab)

本文详细介绍了MATLAB中zeros函数的使用方法,包括生成不同维度的零矩阵、指定矩阵类型、与现有矩阵匹配属性等高级用法。zeros函数是MATLAB中用于创建全零矩阵的重要工具。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

摘自matlab

zeros  Zeros array.
zeros(N) is an N-by-N matrix of zeros.

zeros(M,N) or zeros([M,N]) is an M-by-N matrix of zeros.

zeros(M,N,P,...) or zeros([M N P ...]) is an M-by-N-by-P-by-... array of
zeros.

zeros(SIZE(A)) is the same size as A and all zeros.

zeros with no arguments is the scalar 0.

zeros(..., CLASSNAME) is an array of zeros of class specified by the
string CLASSNAME.

zeros(..., 'like', Y) is an array of zeros with the same data type, sparsity,
and complexity (real or complex) as the numeric variable Y.

Note: The size inputs M, N, and P... should be nonnegative integers. 
Negative integers are treated as 0.

Example:
   x = zeros(2,3,'int8');

用法(翻译)

zeros是一个数组。
zeros(N):生成一个NN的零方阵。
zeros(M,N) or zeros([M,N]):生成一个M
N的零矩阵。
zeros(M,N,P,…) or zeros([M N P …]) :生成一个MNP…的零矩阵。
zeros(SIZE(A)):生成一个和A格式完全相同的零矩阵。
没有参数的0就是数值0。(confusing)
zeros(…, CLASSNAME) :指定这个零矩阵中的值为某某型(int,double,long等等)
zeros(…, ‘like’, Y):矩阵0和数学变量Y有相同的数据类型,稀疏度和复杂度(实数或者是复数)。(confusing)

注意

输入的M,N,P…都是非负整数,如果是负数一律看做0。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值