create diagonal matrix zeros

4 visualizaciones (últimos 30 días)
Ben Mai
Ben Mai el 28 de En. de 2020
Respondida: Ben Mai el 28 de En. de 2020
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

Respuesta aceptada

the cyclist
the cyclist el 28 de En. de 2020
a = diag(1:10);
a(1,:) = 1:10;
a(:,1) = 1:10;

Más respuestas (1)

Ben Mai
Ben Mai el 28 de En. de 2020
Thank you :)

Categorías

Más información sobre Operating on Diagonal Matrices en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by