Question: need help creating a matrix procedure of user specified size

I am trying to set up a procedure for creating a matrix of user specified size.  Basically, I want the user to be able to specify the size and the values of the internal parameters and maple will generate the matrix.  The matrix has the form:

[e   h1   0   0   ...    0]

[h1  e    h   0   ...    0]

[0    h    e   h   ...    0]

...

[0  ...   h    e   h      0]

[0  ...   0    h   e     h2]

[0  ...   0    0   h2   e-b]

(sorry for the cumbersome representation)

Essentially, I am trying to establish an NxN matrix with matrix elements where M[n,n]=e for all n, except n=N, where M[N,N]=e-b. Additional constraints are M[1,2]=M[2,1]=h1, M[N,N-1]=M[N-1,N]=h2, and M[n+/-1,n]=h (for entries between M[2,3] and M[N-2,N-1]).

 

I have had fairly limited experience with procedures in maple and the online information has been of little help.  Thank you so much for your input, it is greatly appreciated. 

Please Wait...