{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ex2_5 - augment initial conditions onto vectors for...

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

View Full Document Right Arrow Icon
% 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
Image of page 1
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

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern