How can i get matrix element for a complex values?

3 ビュー (過去 30 日間)
JOONHYUN LEE
JOONHYUN LEE 2019 年 11 月 25 日
コメント済み: Bhaskar R 2019 年 11 月 25 日
i want to put a complex values (ex 1+ 1i) in
3x3 matrix at 1,1 element
how can i make it ?

回答 (2 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 11 月 25 日
編集済み: KALYAN ACHARJYA 2019 年 11 月 25 日
Just as other number,
mat=[1 2 2+3i;4 5 7;6 10 2]

Bhaskar R
Bhaskar R 2019 年 11 月 25 日
% suppose a fake matrix with size 3x3
>> A = rand(3);
A =
0.7922 0.0357 0.6787
0.9595 0.8491 0.7577
0.6557 0.9340 0.7431
% assign a complex value at loation (1, 1)
>> A(1, 1) = 1+1i;
A =
1.0000 + 1.0000i 0.0357 + 0.0000i 0.6787 + 0.0000i
0.9595 + 0.0000i 0.8491 + 0.0000i 0.7577 + 0.0000i
0.6557 + 0.0000i 0.9340 + 0.0000i 0.7431 + 0.0000i

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by