how to use matlab express the fomula

2 views (last 30 days)
I need help ,please!
QQ图片20190627223439.png

Accepted Answer

James Browne
James Browne on 28 Jun 2019
Hi, I think I have a solution to your problem. It is difficult to determine what kinds of data are the inputs without seeing a sample of the data so I wrote the solution, assuming that Xk and Yk are vectors of length N. In your problem statement, N is 99,900, so then Xk and Yk should be vectors of length 99,900. I used shorter vecors in my code and subsequently, a smaller N value but all you should need to do is use your data and change N to be 99,900 and you should be fine.
The following is the solution that I came up with to implement the EVM equation in MATLAB:
%Since I do not have any example data, the following values were used for
%Xk, N, and Yk, simply change them with real data to implement the EVM
%equation
N = 5;
Xk = [1, 3, 2, 5, 10];
Yk = [7, 9, 3, 6, 2];
ek = Yk - Xk;
%The following calculations can be combined into a single line of code,
%however, I often find it useful for troubleshooting and understanding the
%algorithm to do the calculations in steps. The following is an example of
%an algorithm (the EVM equation) that is broken up into steps.
ek2 = ek.^2;
Xk2 = Xk.^2;
sigmaEk2 = sum(ek2);
sigmaXk2 = sum(Xk2);
EVM = 20*log10( sqrt( (1/N*sigmaEk2)/(1/N*sigmaXk2) ))
  1 Comment
long zhang
long zhang on 28 Jun 2019
QQ图片20190628150600.png,,I think this part is also can be expressed as following:
Xk2=Xk.^2;
mean(Xk2);

Sign in to comment.

More Answers (0)

Categories

Find more on Scope Variables and Generate Names in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!