How to code this equation?
조회 수: 2 (최근 30일)
이전 댓글 표시
To improve the significance of the data, a comprehensive evaluation parameter was set in the experiment so that the average values of different sets of test data could be presented in a consistent manner:
where n is the sample size, Yi is the result of testing on a certain sample, and Y_ is the average value.
How to code this equation?
댓글 수: 0
채택된 답변
galaxy
2019년 12월 5일
This formula mean Y = sum of all Y(i) value with i = 1:n
I do not know what is Y(i) so can not write detai.
Please refer symsum
댓글 수: 5
Walter Roberson
2019년 12월 5일
편집: Walter Roberson
2019년 12월 5일
M = (dfdx.^2+dfdy.^2)/2 ;
should be
g = sqrt((dfdx.^2+dfdy.^2)/2);
AG = mean(g(:));
As well as the missing sqrt(), you should not be assigning to M as you are using M for an array size.
추가 답변 (1개)
Walter Roberson
2019년 12월 5일
y_bar = mean(Y);
or
y_bar = sum(Y)./length(Y);
Note: the second of those will malfunction if Y is a 2D array that has more columns than it has rows. The equation does not describe what should happen for 2D arrays, so what the "correct" output is for that case can be argued.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!