Formula for norm(x)
Mostra commenti meno recenti
Hi everyone, please describe me the formula for norm (x) where x is a complex vector?
1 Commento
James Tursa
il 22 Set 2022
Risposta accettata
Più risposte (1)
Assuming you're only interested in p=2, if you already have code that computes norm(x) for real x, you can extend it to complex x via,
norm(x) = norm( [norm(real(x)), norm(imag(x)) ] )
which is easily verified below,
x=complex(rand(5,1), rand(5,1));
norm(x)
norm( [norm(real(x)), norm(imag(x)) ] )
Alternatively, if you have an implementation of abs, you could do norm(abs(x),p) which will work for any p-norm
p=3;
norm(x,p)
norm(abs(x),p)
Categorie
Scopri di più su Physics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!