How to judge a number is complex in MATLAB How to write the sentence "if a is plural"

How to judge a number is complex in MATLAB How to write the sentence "if a is plural"


if ~(isreal(a))



How to take the real part and imaginary part of a complex number in MATLAB


a=1+2i
shibu=real(a)
xubu=imag(a)



Matlab symbol operation, coefficient extraction problem
For example, a signed polynomial, a * cos (a) * cos (b) + b * sin (a) * sin (b) + C * cos (a) + D * sin (b), the variables in this expression include four, cos (a) * cos (b), sin (a) * sin (b), cos (a), sin (b), how to find their coefficients a, B, C, D?
Maybe the problem is not described clearly. There are six equations in total. For example, the first equation is
Py * cos (a + b) - 1084 * NY * cos (a + b) + 1084 * NX * sin (a + b) - Px * sin (a + b) = 126 * sin (D + e) + 1560 * sin (d) - 1700 * sin (b), except for a and B, the rest are constants. If six independent variables, sin (a) * sin (b), sin (a) * cos (b) cos (a) * sin (b), cos (a) * cos (b), cos (a) and sin (a), are taken as variables, these six equations are constructed into matrix form, ax = f (B, D, e), ax is the left side of the equation, f (B, d), ax is the left side of the equation, e) On the right side of the equation,
Where x = [sin (a) * sin (b), sin (a) * cos (b), cos (a) * sin (B,) cos (a) * cos (b), cos (a), sin (a)] t, X is a six row column vector, how to find its coefficient matrix A?


Write a coefficient extraction function in MATLAB, using string and variable conversion



If the equation x2 + (1 + 2I) x - (3m-1) I = 0 has real roots, then the value of pure imaginary number m is______ .


Let the pure imaginary number M = AI, where a ≠ 0 and a ∈ R. since x is a real number, there are x2 + X + 3A + (2x + 1) I = 0. ∧ x2 + X + 3A = 02x + 1 & nbsp; = 0, ∧ a = 112, ∧ M = 112i. So the answer is: 112i