Tartalomjegyzék

Script d2017_09_21_ccs_gyak2_eloben

TELJES MATLAB SCRIPT KIEGÉSZÍTŐ FÜGGVÉNYEKKEL

file:   d2017_09_21_ccs_gyak2_eloben.m
author: Peter Polcz <ppolcz@gmail.com>
Created on 2017. September 21.
Output:
┌d2017_09_21_ccs_gyak2_eloben
│   - Persistence for `d2017_09_21_ccs_gyak2_eloben` reused (inherited) [run ID: 3125, 2017.09.21. Thursday, 11:59:13]
│   - Script `d2017_09_21_ccs_gyak2_eloben` backuped
A = randn(3);
B = rand(3,1);

K = place(A,B,[-1+1i,-1-1i,-0.5]);

A = A - B*K;

eig(A)

x0 = [1 ; 2];

f_fh = @(t,x) A*x;

figure, hold on
for i = 1:200
    [t,x] = ode45(f_fh, [0 10], randn(3,1));
    plot3(x(:,1),x(:,2),x(:,3))
    plot3(x(1,1),x(1,2),x(1,3),'.')
end
Output:
ans =
  -0.5000 + 0.0000i
  -1.0000 + 1.0000i
  -1.0000 - 1.0000i

End of the script.

Output:
└ 1.3404 [sec]