{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ex2_5 - augment initial conditions onto vectors for...

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

% Example 2.5 % a = [-1 -2]; b = [0 0 0]; n = 2:10; x = zeros(1,length(n)); % creates a zero vector x0 = [0 0]; y0 = [1 3]; y1 = recur(a,b,n,x,x0,y0); % solution via recursion y2 = (4*(2).^n - (-1).^n)/3; % analytical solution % n is a vector, so the operation .^ is used to compute % the exponent separately for each element
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % % augment initial conditions onto vectors for plotting y1 = [y0 y1]; y2 = [y0 y2]; n = 0:10; plot(n,y1,'o',n,y2,'+') title('Example 2.5') ylabel('y[n]') xlabel('n') text(1,1000,'o solution obtained using recur') text(1,850,'+ solution obtained from analytical expression')...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern