Calculate the Extended Matrix of matrix A as single matrix. Calculate the Extended Matrix of matrix A as single matrix where n is the degree of A and m is the degree of the state vector x in homogeneous form. Prototype: [Ae] = extendedMatrix(A, n, m, hState, d) Input: A - nxn matrix with Syms affine parameters. n - Degree of A. m - Degree of the state vector x in homogeneous form. hState - Homogeneous state vector. d - Dimension of homogeneous state vector hState. Output: newA - Extended Affine Matrix A as single matrix
0001 %Calculate the Extended Matrix of matrix A as single matrix. 0002 % 0003 %Calculate the Extended Matrix of matrix A as single matrix where n is the 0004 %degree of A and m is the degree of the state vector x in homogeneous form. 0005 % 0006 %Prototype: [Ae] = extendedMatrix(A, n, m, hState, d) 0007 % 0008 %Input: A - nxn matrix with Syms affine parameters. 0009 % n - Degree of A. 0010 % m - Degree of the state vector x in homogeneous form. 0011 % hState - Homogeneous state vector. 0012 % d - Dimension of homogeneous state vector hState. 0013 % 0014 %Output: newA - Extended Affine Matrix A as single matrix 0015 0016 function [ Ae ] = extendedMatrix( A, n, m, hState, d ) 0017 0018 syms x; 0019 for i = 1:n 0020 x(i) = ['x_' int2str(i)]; 0021 end 0022 0023 for i = 1:n 0024 xdiff(:,i) = diff(hState, x(i)); 0025 end 0026 0027 clear x; 0028 syms x; 0029 0030 for i = 1:n 0031 x(i,1) = ['x_' int2str(i)]; 0032 end 0033 0034 result = expand(xdiff*A*x); 0035 0036 syms Ae; 0037 for i = 1:length(result) 0038 for j = 1:length(hState) 0039 chr = char(expand(result(i)/hState(j))); 0040 Ae(i, j) = getCoefficientFromString(chr); 0041 end 0042 end 0043 0044 return; 0045 0046 end