clear; close all; s = tf('s'); Ns = 1:9; for idx = 1:length(Ns) n = Ns(idx); D = 1; for jdx=1:n j = jdx; sigma_j = -sin((2*j-1)/(2*n)*pi); omega_j = cos((2*j-1)/(2*n)*pi); sj = sigma_j + i*omega_j; D = D*(s-sj); end coef(D) end function n = coef(D) [n,d] = tfdata(D); n = cell2mat(n); n = n(2:end); n = real(n); end
実行結果
ans = 1 ans = 1.4142 1.0000 ans = 2 2 1 ans = 2.6131 3.4142 2.6131 1.0000 ans = 3.2361 5.2361 5.2361 3.2361 1.0000 ans = 3.8637 7.4641 9.1416 7.4641 3.8637 1.0000 ans = 4.4940 10.0978 14.5918 14.5918 10.0978 4.4940 1.0000 ans = 5.1258 13.1371 21.8462 25.6884 21.8462 13.1371 5.1258 1.0000 ans = Columns 1 through 8 5.7588 16.5817 31.1634 41.9864 41.9864 31.1634 16.5817 5.7588 Column 9 1.0000