Why Does numel() Accept More than One Argument?
조회 수: 2 (최근 30일)
이전 댓글 표시
@doc:numel indicates that the function accepts only a single argument. But it can be called with more than one argument and it returns a result.
which numel(rand(3),rand(5))
numel(rand(3),rand(5)) % return numel of the second argument?
which numel(rand(3),rand(5),rand(4))
numel(rand(3),rand(5),rand(4)) % returns ?
채택된 답변
Animesh
2024년 5월 24일
When the numel function in MATLAB is called with more than one input argument, it returns the product of number of elements in the parameters after the first.
Hence the following code snippet returns 400, i.e. "numel ( rand ( 5 ) ) * numel ( rand ( 4 ) )":
numel(rand(3),rand(5),rand(4))
numel(rand(5)) * numel(rand(4))
You can refer the following MATLAB Answer for more information:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!