Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N = 1;
- A = -2*eye(N); % N tells how many rows and columns in the matrix
- L = 5;
- K = 1;
- % R = K/delta_X^2 (1)
- %L = N*delta_x (2)
- % => delta_x = L / N (3)
- % (2) + (3) => R = K/((L/N)*(L/N))
- R = K/((L/N)*(L/N));
- L1 = [1:N-1]*0; % 1xN-1 = [0 0 0 0 ... ] n-1 klp
- L2 = [1:N]'*0;
- R1 = [L2 [eye(N-1); L1]];
- R2 = R1';
- A(N,N) = -1;
- A = R*(A+R1+R2);
- % B matrix
- B = L2;
- B(1) = R; %B = [R 0 0 0...0]
- C = L2' % L2 Transpose
Add Comment
Please, Sign In to add comment