Hi . what is the difference between numel() and length() of a given vector ?
290 ビュー (過去 30 日間)
古いコメントを表示
what is the difference between numel() and length() of a given vector ?
0 件のコメント
採用された回答
KSSV
2021 年 10 月 6 日
編集済み: KSSV
2021 年 10 月 6 日
numel gives you total number of elements present in the array. i.e. it is product of result of size function.
A = rand(10,3) ;
numel(A)
size(A,1)*size(A,2)
length gives you maximum number of size or which ever is dominant along row and column.
A = rand(10,3) ;
length(A)
size(A,1)
%
B = A' ;
length(B)
size(B,2)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!