hw1p2sol

hw1p2sol - f(5)=1; f(16)=-1; x=A\f x = 0.5238 1.0476 1.5714...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Solution of Problem 1.2.20b % % The matrix is tridiagonal with a -1 2 -1 structure A=-spdiags(ones(20,1),-1,20,20)- spdiags(ones(20,1),1,20,20)+2*spdiags(ones(20,1),0,20,20); f=zeros(20,1);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: f(5)=1; f(16)=-1; x=A\f x = 0.5238 1.0476 1.5714 2.0952 2.6190 2.1429 1.6667 1.1905 0.7143 0.2381-0.2381-0.7143-1.1905-1.6667-2.1429-2.6190-2.0952-1.5714-1.0476-0.5238...
View Full Document

Ask a homework question - tutors are online