length函数
分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
1、length函数:计算向量或矩阵的长度
2、用法说明
y = length(x) 函数计算指定向量或矩阵的长度y。如果参数变量x是向量,则返回其长度;如果参数变量是非空矩阵,则length(x)与max(size(x))等价
3、举例说明
>> x = 'youhaidong'x =youhaidong>> y = length(x)y = 10>> x = rand(6,6)x = 0.8147 0.2785 0.9572 0.7922 0.6787 0.7060 0.9058 0.5469 0.4854 0.9595 0.7577 0.0318 0.1270 0.9575 0.8003 0.6557 0.7431 0.2769 0.9134 0.9649 0.1419 0.0357 0.3922 0.0462 0.6324 0.1576 0.4218 0.8491 0.6555 0.0971 0.0975 0.9706 0.9157 0.9340 0.1712 0.8235>> y = length(x)y = 6
4、附录
>> help lengthlength Length of vector. length(X) returns the length of vector X. It is equivalent to MAX(SIZE(X)) for non-empty arrays and 0 for empty ones. See also numel. Overloaded methods: timer/length serial/length daqdevice/length daqchild/length distributed/length codistributed/length Composite/length gpuArray/length fints/length videosource/length videoinput/length visa/length udp/length tcpip/length icgroup/length icdevice/length i2c/length gpib/length Bluetooth/length xregpointer/length mbcstore/length guidarray/length cgrules/length designdev/length des_constraints/length coninputfactor/length xregcontainer/length xregmulti/length xregcovariance/length xregmonitorplotproperties/length xregdataset/length cgtradeoffkeytable/length dataset/length categorical/length tscollection/length Reference page in Help browser doc length
给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
相关阅读
assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义: #include <assert.h> void assert(
C++中STL里提供了许多字符串操作的函数,下面是字符串查找方面的部分函数用法简介: 1.find() 查找第一次出现的目标字符串: #include<
理解VRF之前,需要先理解带秘钥的哈希函数,和传统的哈希函数不同,带秘钥的哈希函数在计算HASH数值的时候引入了一个不公开的秘钥,这样
说明 在给定的几组数组中,将数组间对应的元素相乘,并返回乘积之和。 语法 SUMPRODUCT(array1, [array2], [array3], ...) SUMPR
一、unix_timestamp函数用法 1、unix_timestamp() 得到当前时间戳 2、如果参数date满足yyyy-MM-dd HH:mm:ss形式,则可以直接unix