Creating a banded matrix with spdiags in MATLAB

  • Thread starter Thread starter Huumah
  • Start date Start date
  • Tags Tags
    Matlab Matrix
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 4K views · last reply
Huumah
Messages
27
Reaction score
0
Equation 2.34: a banded system matrix with rows 16 -9 8/3 -1/4; -4 6 -4 1; 1 -4 6 -4 1 down to the last rows 16/17 -60/17 72/17 -28/17; -12/17 96/17 -156/17 72/17, multiplying column vector y1 to yn, equal to h^4/EI times column vector f(x1) to f(xn).


I'm trying to make a banded matrix in MATLAB like the one in my picture.

I'm trying to use the spdiags function but I'm not going even close to getting the same matrix.

I have tried the help in Matlab but have had no luck yet.

How can you tell the bandwidth is 7?
 
Last edited:
Physics news on Phys.org
Can you explain in more details what you have tried?

And the bandwith here is 5.