Complex double Array converts to double array after assignment
Mostra commenti meno recenti
Hi Experts,
a = [1 2; 3 4];
b = [1 2; 3 4];
c = complex(a,b);
a1 = complex(a,0);
a1(1,1) = complex(abs(c(2,2)),0);
Above assignment somehow converts 'a1' to a DOUBLE array instead of COMPLEX double. I'm using the above method for assignment to a 3D array (S-parameter processing) which is facing the same issue in a code. Why would this be happening ??
Risposta accettata
Più risposte (1)
Massimo Zanetti
il 27 Set 2016
Modificato: Massimo Zanetti
il 27 Set 2016
Sure it does, because a complex number with a NULL imaginary part is indeed real. Notice that in the call COMPLEX(a,0), you in fact sets the imaginary part to 0. If you want to create a complex number without imaginary part do this:
a1=complex(a);
This will give a1 as COMPLEX.
1 Commento
Vids deo
il 27 Set 2016
Categorie
Scopri di più su Logical 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!