how to use matlab express the fomula

2 次查看(过去 30 天)
I need help ,please!
QQ图片20190627223439.png

采纳的回答

James Browne
James Browne 2019-6-28
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 个评论
long zhang
long zhang 2019-6-28
QQ图片20190628150600.png,,I think this part is also can be expressed as following:
Xk2=Xk.^2;
mean(Xk2);

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scope Variables and Generate Names 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by