Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [M,B]=genMatrix(n)
- M=zeros(n,n) + diag(3* ones(1,n)) + diag(-1* ones(1,n-1),1) + diag( -1* ones(1,n-1),-1);
- col=zeros(1,n);
- col(1)=2.5;
- col(n)=2.5;
- col(n/2)=1;
- col(n/2+1)=1;
- for i=1:n
- if(i~=(n/2) && i~=(n/2+1))
- M(i,n+1-i)=1/2;
- end
- if(col(i)==0)
- col(i)=1.5;
- end
- end
- B=transpose(col);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement