how to use matlab express the fomula
2 次查看(过去 30 天)
显示 更早的评论
I need help ,please!
0 个评论
采纳的回答
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) ))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!