rref using complex numbers

3 ビュー (過去 30 日間)
Jackson Andrew
Jackson Andrew 2022 年 10 月 10 日
コメント済み: Jackson Andrew 2022 年 10 月 10 日
I am trying to find the rref form of a matrix with imaginary components. Not sure if my lack of linear algebra is what's holding me back or my matlab knowledge. Below is my code.
clc
clear
node1 = [complex(.25,-.2) complex(0,.2) complex(12.46,-.9)]
node2 = [complex(0,.2) complex(.1,-.2) 0]
a = [node1; node2];
rref a
I'm getting these errors
Error using norm
First argument must be single or double.
Error in rat (line 57)
tol = 1.e-6*norm(X(isfinite(X)),1);
Error in rref (line 26)
[num, den] = rat(A);
Error in ecehomework7 (line 6)
rref a
yes this is for a homework assignment but I was specifically told I could use matlab in case that helps ease your consciousness, thanks in advance!

採用された回答

David Hill
David Hill 2022 年 10 月 10 日
node1 = [complex(.25,-.2) complex(0,.2) complex(12.46,-.9)];
node2 = [complex(0,.2) complex(.1,-.2) 0];
a = [node1; node2];
rref(a)
ans =
1.0000 + 0.0000i 0.0000 + 0.0000i 37.5366 + 1.8226i 0.0000 + 0.0000i 1.0000 + 0.0000i 30.7584 -13.5565i
  1 件のコメント
Jackson Andrew
Jackson Andrew 2022 年 10 月 10 日
Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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