Create a matrix using offset elements of a vector
Mostra commenti meno recenti
Let say I have a vector v = [v1, v2, v3], I would like to create a non-square matrix putting the vector v as tridiagonal elements like this ,
matrix = [v1, v2, v3, 0, 0, 0,..., 0;
0 , v1,v2,v3, 0, 0 ,...,0;
0 , 0, v1,v2,v3,0,.....,0;]
I know there's a diag command but it's only for square matrix. What's the way of creating a non-square matrix?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Resizing and Reshaping Matrices in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!