Create Banded Matrix in MATLAB - Step-by-Step Guide

  • Thread starter Thread starter Huumah
  • Start date Start date
  • Tags Tags
    Matlab Matrix
Click For Summary
To create a banded matrix in MATLAB, the spdiags function is commonly used, but users may struggle to achieve the desired output. Clarification on how to determine the bandwidth, which in this case is 5, is essential for proper implementation. Detailed guidance on the specific steps taken by the user can help identify where the issues lie. It's important to ensure that the correct parameters are being passed to the spdiags function. Understanding these concepts will facilitate the successful creation of the banded matrix.
Huumah
Messages
27
Reaction score
0
28eC1QV.png


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.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
4K
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K