MATLAB: Large Matrices for solving linear systems

arraymatrix

Can someone help me, I need to create the pentagonal matrix associated with the Laplace equation.. So -4 along the diagonal and 4 diagonals with 1’s. I want to be able to change the size, initially I was wanting N=33, hence 1024 x 1024.
Also an array with different values, I know I can do b=(ones(N-1)*(N-1),1) with ones or zeros, but is there a way to create a large array with different values.
I have codes for all my methods of solving linear systems, just cant create a matrix A

Best Answer

I think you may find this documentation example useful.
Related Question