- #1
realanony87
- 9
- 0
I am trying to create the following Matrix without the use of a for loop.
1 2 1 0 0 0 0 0 0 0 0 0
0 0 1 2 1 0 0 0 0 0 0 0
0 0 0 0 1 2 1 0 0 0 0 0
0 0 0 0 0 0 1 2 1 0 0 0
Etc.
Is there a simple way of doing this
Edit: Using Matlab
1 2 1 0 0 0 0 0 0 0 0 0
0 0 1 2 1 0 0 0 0 0 0 0
0 0 0 0 1 2 1 0 0 0 0 0
0 0 0 0 0 0 1 2 1 0 0 0
Etc.
Is there a simple way of doing this
Edit: Using Matlab
Last edited: