How i can create one specific matrix 100X100?

8 visualizzazioni (ultimi 30 giorni)
The form of the matrix is
How i can create that can anyone help?

Risposta accettata

Star Strider
Star Strider il 12 Gen 2015
Modificato: Star Strider il 12 Gen 2015
This works:
v = -[1:100]';
vu = triu(repmat(v, 1, size(v,1)));
vl = tril(repmat(-v', size(v,1), 1));
out = vu + vl + diag(-v);

Più risposte (1)

kavya k
kavya k il 16 Mag 2017
how to create a 240*320 matrix containing the data 0.1991 in all the cells.can anyone help me.

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by