diary20050216

diary20050216 - hold on plot(x,fx) A A = [ s ones(11,1)]...

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

View Full Document Right Arrow Icon
% Matlab diary from cs110a, Feb 16 2005. % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. censusgui load censusdata t s = (t-1950) /50 clc s s .^ 3 A = [s .^ 3 , s .^ 2 , s , ones(11,1)] y p = A \ y plot(t,y,'o') hold on x = [1880 : 10 : 2020] fx = polyval(p, (x-1950)/50);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: hold on plot(x,fx) A A = [ s ones(11,1)] logy = log(y) p = A \ logy lambda = p(1) k = exp(p(2)) exp(1) x fx = k * exp(lambda * (x-1950)/50) plot(x,fx,'r') clf reset semilogy(t,y,'o') hold on semilogy(x,fx,'r') clc A A = [s .^ 3 , s .^ 2 , s , ones(11,1)] qrsteps(A);...
View Full Document

This note was uploaded on 12/27/2011 for the course CMPSC 110a taught by Professor Gilbert during the Fall '09 term at UCSB.

Ask a homework question - tutors are online