Exercise 4.4 (a) Let F- Use MATLAB to find an invertible matrix P and a diagonal matrix D such that PDr F (b) Use MATLAB to compare F10 and PD Op c) Let f= (1,1)T Compute Fr, Fr, F r FL Ft Describe the pattern in your answers. d) Given a sesquence of numbers ([.1.2.3.5,8. 13.) where each term is the sum of the previous two, find the 30th term of this sequence. if you are stuck., read the remark below) 13

## Answer

**Matlab code:**
==============
%%% part-a

f=[0 1;1 1]

[P D]=eig(f); % finding Eigenvalues and eigenvectors of f

P

D

P*D*P^-1
%%% part-b

F=f^10

P*D^10*P^-1
%%% part-c

f=[1 1]’;

F=[0 1;1 1];

F*f

F^2*f

F^3*f

F^4*f

F^5*f

% (F^n)*f gives the n+1 and n+2 term of fibonacci series
%%% part-d

% required fibonacci term =30

% n+2=30 => n=28

F^28*f
=================
**Output:**

Editor G:Program Files MATLAB R2017alinMatx.m Ox Com mand Window >>linMatx 888 part-a f= [O [P D-eig (f); % finding Eigenvalues and eigenvectors of f 2- 1:1 1] part-b 10-PD 10 pA-1 part-c 888 r-f^10 9- -0.8507 0.5257 0.5257 0.8507 889 f= [11]’; F-I0 1:1 11: 12 13- 15- 16F 2 F 17-F3 18F 4 -0.6180 1.6180 20 (F^ n) *f gives the n+1 and n+2 term of fibonacci series ans part-d required n+2=30 -0.0000 1.0000 1.0000 1.0000 23 24 25F 28 26 fibonacci => term -30 % n-28