MATLAB Answers

How to code this equation?

1 view (last 30 days)
Alvin Alvin
Alvin Alvin on 5 Dec 2019
Commented: Alvin Alvin on 5 Dec 2019
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:
1 (1).png
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 Comments

Sign in to comment.

Accepted Answer

galaxy
galaxy on 5 Dec 2019
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 Comments

Show 2 older comments
galaxy
galaxy on 5 Dec 2019
If Y is the average value, so the formular will as same as following.
formula.PNG
You can use the code from Walter Roberson.
Walter Roberson
Walter Roberson on 5 Dec 2019
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.
Alvin Alvin
Alvin Alvin on 5 Dec 2019
thanks Walter Roberson, give your answer will accept your answer for this question

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 5 Dec 2019
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 Comments

Sign in to comment.

Sign in to answer this question.


Translated by