From this matrix pattern, how to create a matrix iterations automatically? Thanks guys

Answers (1)

V = [-3 1 0 0 0]
M = toeplitz(V,V)

3 Comments

Hi Jos, thanks for your answer.
My desired matrix not only 5x5 (can be 10x10 , 20x20 , or more ) . But the pattern diagonal matrix such that I made ( 5x5 ) . How to make coding iteration ?
N = 10 ; % or 5, or 20, but => 2
V = [-3 1 zeros(1,N-2)] ;
toeplitz(V)

Sign in to comment.

Categories

Community Treasure Hunt

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

Start Hunting!