quiz11b_solution

quiz11b_solution - Introduction to Computational Physics...

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction to Computational Physics Phy 265 Quiz 11b (In-Lab) Solution 1. 2. 3. q=quad('1.0/(2*pi)^(1/2)*exp(-x.^2/2)',-1.5,1.5) q = 0.8664 A=[3 2 -1;2 -2 4;-1 0.5 -1]; b=[1;-2;0]; A\b ans = 1.0000 -2.0000 -2.0000 s=0; for n=1:1000; s=s+1.0/n^2; end fprintf('Series has value of %.4f\n',s); Series has value of 1.6439 ...
View Full Document

Ask a homework question - tutors are online