How does function std process complex numbers
Show older comments
In function S = std(A), there are complex numbers in matrix A. How does std calculate on complex numbers?
Thanks
Accepted Answer
More Answers (1)
John D'Errico
on 15 Jul 2019
Edited: John D'Errico
on 15 Jul 2019
std uses the formula that is given by David, which is just the standard fornula, with no difference for complex inputs. But just to add a couple of useful formulas that apply for complex arguments:
var(V) = var(real(V)) + var(imag(V))
std(V) = sqrt(std(real(V))^2 + std(imag(V))^2 )
For example:
V = rand(1,5) + rand(1,5)*i;
var(V)
ans =
0.20393
var(real(V)) + var(imag(V))
ans =
0.20393
std(V)
ans =
0.45159
sqrt(std(real(V))^2 + std(imag(V))^2 )
ans =
0.45159
1 Comment
Rik
on 14 Feb 2022
Nice!!
Categories
Find more on Descriptive Statistics 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!