Create a matrix
|
01-26-2019, 11:19 AM
Post: #1
|
|||
|
|||
Create a matrix
Specifically, I would like to create a matrix, using a 3 element specified pattern, (tridiagonal), with a specified number of rows and columns. The center value of the pattern should be on the main diagonal of the matrix:
Some kind of variation on this (non-working) theme: makemat([-1,2,-1], 5,5); // Uses the pattern -1,2,-1 in a 5x5 matrix, with 2 on the main diagonal: [[2,-1,0,0,0], [-1,2,-1,0,0], [0,-1,2,-1,0], [0,0,-1,2,-1], [0,0,0,-1,2]] I (think) this can be done using the matlab eye() command, for example. Any ideas how to create a custom matrix in similar fashion, on the prime? -Dale- |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Create a matrix - DrD - 01-26-2019 11:19 AM
RE: Create a matrix - JMB - 01-26-2019, 12:00 PM
RE: Create a matrix - DrD - 01-26-2019, 03:18 PM
RE: Create a matrix - JMB - 01-26-2019, 05:49 PM
|
User(s) browsing this thread: 1 Guest(s)