How to perform complex calculation in matlab

67 vues (au cours des 30 derniers jours)
Jb179
Jb179 le 4 Déc 2017
How would I go about performing calculations using complex numbers? Below is the equation I'm trying to implement
E = V + X*I
Where V = 1 , X = 2j and I = 25 at an angle of 10. I want to be able to do it in terms of the variables since V, X and I are user inputs

Réponses (2)

KSSV
KSSV le 4 Déc 2017
Representing complex numbers in matlab is easy and straight forward. Read more here: https://in.mathworks.com/help/matlab/complex-numbers.html
z = 1 + 3*1i ; % make a complex number
R = real(z) % Extract real part of Z
I = imag(z) % Extract imaginary part of Z
A = abs(z) ; % GEt absolute of complex number

Walter Roberson
Walter Roberson le 4 Déc 2017
V = 1;
X = 2j;
I = 25;
E = V + X .* I;
If the user is expected to input X without the 'j' part then just
V = 1;
X = 2;
I = 25;
E = V + X*1j .* I;

Catégories

En savoir plus sur Elementary Math dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by