If you don't mind a bit of algebra, you could write the equations in terms of their real and imaginary parts:
M A = B
(Re M + i Im M) (Re A + i Im A) = (Re B + i Im B)
(Re M) (Re A) - (Im M) (Im A) = Re B
(Re M) (Im A) + (Im M) (Re A) = Im B
The latter two equations are two coupled (real) equations for the unknowns Re A and Im A, which you can solve for using Math::MatrixReal as in your example.
Update: You could write these two coupled equations as one matrix equation:
/ Re M -Im M \ / Re A \ / Re B \
| | | | = | |
\ Im M Re M / \ Im A / \ Im B /
and then use Math::MatrixReal as before.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|