Find Sum of array
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, i am trying to find the sum of an array that contains elements that contain decimals. How would i go about doing this? the sum function is not working.
the array is:
0
0.410000000000000
0.330000000000000
0.330000000000000
0.350000000000000
0.350000000000000
0.340000000000000
0.360000000000000
0.340000000000000
0.330000000000000
0.340000000000000
0.360000000000000
thank you for your help
댓글 수: 0
답변 (1개)
James Tursa
2020년 11월 13일
It may be that you have a local variable called sum that is shadowing the MATLAB sum function. Try clearing it first:
clear sum
And then avoid using sum as a variable name in the future.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!