# how to use matlab express the fomula

1 view (last 30 days)
long zhang on 27 Jun 2019
Commented: long zhang on 28 Jun 2019

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) ))
long zhang on 28 Jun 2019
，，I think this part is also can be expressed as following:
Xk2=Xk.^2;
mean(Xk2);

### Categories

Find more on Multicore Processor Targets 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!

Translated by