%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % my scripts for bits and pieces of the Tridiagonal demonstration %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function rhs=setrhs(i,N) % setrhs - sets the right hand side matrix for 1 on each end and a spike of one at index i % rhs=zeros(N,1); % start by make r a zero vector of length N rhs(1)=1; % set the height of tank 1 to 1 rhs(N)=1; % set the height of tank N to 1 rhs(i)=1; % and put a flux of 1 in component return