create diagonal matrix zeros

5 ビュー (過去 30 日間)
Ben Mai
Ben Mai 2020 年 1 月 28 日
回答済み: Ben Mai 2020 年 1 月 28 日
I'm trying to create a matrix like this:
I'm able to create one matrix with a=diag(1:10)
and another with b=(1:10)+(0:9)'
But I don't know how to combine them together to get A.
Thanks for your help

採用された回答

the cyclist
the cyclist 2020 年 1 月 28 日
a = diag(1:10);
a(1,:) = 1:10;
a(:,1) = 1:10;

その他の回答 (1 件)

Ben Mai
Ben Mai 2020 年 1 月 28 日
Thank you :)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by