Multiplication of matrix with It's Diagonal Element to It's Row
1 回表示 (過去 30 日間)
古いコメントを表示
CHANDRA SHEKHAR BESTA
2014 年 2 月 15 日
編集済み: CHANDRA SHEKHAR BESTA
2014 年 2 月 15 日
I Have this below matrix.
z=[a11 a12 a13;
b21 b22 b23;
c31 c32 c33]
I want out put of the Matrix like this.
q=[1 -(a12/a11) -(a13/a11);
(-b21/b22) 1 (-b23/b22);
(-c31/c33) (-c32/c33) 1]
Can you please send me program for this Matrix operation.
0 件のコメント
採用された回答
Azzi Abdelmalek
2014 年 2 月 15 日
編集済み: Azzi Abdelmalek
2014 年 2 月 15 日
a=[1 2 3;4 5 6;7 8 9]
out=bsxfun(@rdivide, -a,diag(a))
out(sub2ind(size(a),1:size(a,1),1:size(a,1)))=1
3 件のコメント
Azzi Abdelmalek
2014 年 2 月 15 日
You should precise that.
m=tf(1,1:2)
a=[m m*2;1+m 5*m+2] % Example
%-------------------------
b=repmat(tf(1,1),size(a))
for k=1:size(a,1)
b(k,:)=-a(k,:)/a(k,k)
b(k,k)=1
end
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Operating on Diagonal Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!