03-11-2023, 01:49 PM
Suppose that I have a Real Matrix A
[[11 0]
[0 22]].
I want to substitute in a program its
real number 22 by real 220.
Then {2 2} 220 PUT does the job
and I get the matrix B1
[[11 0]
[0 220]].
Suppose instead that I want to substitute
the same real number 22 in matrix A
by the complex number (220,1).
Then {2 2} (220, 1) PUT does not do the job.
Is it normal?
To have the job done, I have apparently
a) to test that number
b) then, if it is complex,
multiply previously A by the complex number (1 0);
then only I can write {2 2} (220, 1) PUT
to get the wished matrix B2:
[[(11, 0) (0,0)]
[(0,0) (22, 1)]].
Is there a simpler way to get the job done?
How do I possibly get the "nicer/simpler" looking matrix B'2:
[11 0]
[0 (220, 1)]] (not having the "0-imaginary" partto appear)?
Note
From complex matrix B2
I can get back A simply by:
[[(11, 0) (0,0)]
[(0,0) (22, 1)]]
{2 2 } 22 PUT.
Thanks for your insight.
Gil
[[11 0]
[0 22]].
I want to substitute in a program its
real number 22 by real 220.
Then {2 2} 220 PUT does the job
and I get the matrix B1
[[11 0]
[0 220]].
Suppose instead that I want to substitute
the same real number 22 in matrix A
by the complex number (220,1).
Then {2 2} (220, 1) PUT does not do the job.
Is it normal?
To have the job done, I have apparently
a) to test that number
b) then, if it is complex,
multiply previously A by the complex number (1 0);
then only I can write {2 2} (220, 1) PUT
to get the wished matrix B2:
[[(11, 0) (0,0)]
[(0,0) (22, 1)]].
Is there a simpler way to get the job done?
How do I possibly get the "nicer/simpler" looking matrix B'2:
[11 0]
[0 (220, 1)]] (not having the "0-imaginary" partto appear)?
Note
From complex matrix B2
I can get back A simply by:
[[(11, 0) (0,0)]
[(0,0) (22, 1)]]
{2 2 } 22 PUT.
Thanks for your insight.
Gil