How to perform complex calculation in matlab
66 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
KSSV
on 4 Dec 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
0 Comments
Walter Roberson
on 4 Dec 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;
0 Comments
See Also
Categories
Find more on Elementary Math 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!