Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how do i input this in built in funtions
조회 수: 1 (최근 30일)
이전 댓글 표시
multiply and count elements
댓글 수: 0
답변 (2개)
Star Strider
2015년 2월 9일
I’m not certain what you want, so I’ll venture this:
x=[3,7,2,9,4];
product_x = prod(x)
elements_x = length(x)
elements_x = numel(x)
produces:
product_x =
1512
elements_x =
5
elements_x =
5
댓글 수: 0
Image Analyst
2015년 2월 9일
If m is your matrix:
theProduct = prod(m(:)); % Multiply all elements together.
theCount = numel(m); % Count the number of elements in the array.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!