function [Phi, Gamma] = c2d(a, b, t) %C2D continuous system to discrete time system conversion n = size(a,1); m = size(b,2); s = expm([[a,b]*t; zeros(m, n+m)]); Phi = s(1:n, 1:n); Gamma = s(1:n,n+1:n+m); endfunction