Designing butterworth filter with pole placement I am trying to design a Nth order continous time Butterworth filter in state space, with pole placement technique.

n = varargin{1}
Fc = this.fc 
wc = 2*pi*Fc;
T = 1/(2*pi*Fc);
%----------------Finding Poles--------------------------
 p = exp(1i*(pi*(1:2:n-1)/(2*n) + pi/2)); %n is the order of the filter
                 p = [p; conj(p)];
                 p = p(:);
                 if rem(n,2)==1   % n is odd
                     p = [p; -1];
                 end
%----------------Finding Filter co efficents---------------
                 if length(p)&lt;= 2
                    a = conv([1,-p(1)],[1,-p(2)]);
                end
                if length(p) &gt; 2
                    a = conv([1,-p(1)],[1,-p(2)]);
                    for i = 3: length(p)
                        a = conv(a,[1,-p(i)]);
                    end
                end
                a = real(a)
                a = fliplr(a);
%----------------- calculating the matricies%-----------------

            %--------------A matrix---------------
            N = length(a)-1;% order of the matrix
            last_row = (a(1:end-1))*(-1/a(end));% creating the last row

             last_row = (wc.^(N:-1:1)).*last_row;% creating the last row

            k = ones(1,N-1);
            this.x = diag(k,1) ; % diag(vector, k) produce a matrix filled with zero's and k'th off diagonal as vector, in this  case, 1's.
            this.x(end,:) = last_row;% adding the last_row

            %-------------desiging B matrix--------------
            this.y = zeros(N,1); % creates a coloumn matrix with zeros
            this.y(N,:) = 1/(a(end)*wc^n); % writes last elements as a

            %--------------- writing C matrix--------------
            this.z = zeros(1,N); %creates a row matrix
            this.z(1,1) = 1;

            %------------ writing the D matrix----------------

            this.u = [0];


I know the code is bit lengthy, but i have tried everything, but can't figure out where i am going wrong. Because I am not getting any error. The resultant output is just 0. The code is pretty simple, I find the poles, then the filter coefficients. with the filter coefficients. i design A,B;C,D Matrices. 
This is a continuous butterworth filter, Can anyone point the mistake i am doing?

edit1:
A low pass PT2 filter:


A low pass 2nd order butterworth filter:
I think I found the problem. Everything was fine except for the denormalization step for arbitrary cut-off frequencies wc. I changed the following lines to obtain the correct state-space matrices (and to handle the case n=1):


...
if (n == 1)
    a = [1,1];
else
    p = ...
    ...
end

a = real(a);
a = a./(wc.^(n:-1:0))   % new!
a = fliplr(a);
...

% last_row = (wc.^(N:-1:1)).*last_row;    % removed!

if( n == 1)
    this.x = last_row;
else
    k = ones(1,N-1);
    this.x = diag(k,1) ;
    this.x(end,:) = last_row;
end

...

this.y(N,:) = 1/a(end);    % changed!

...



I used the function ss2tf to compute the polynomial coefficients from the state-space matrices computed above, and the coefficients were correct for different values of wc. This means that the matrices are correct. If the output signal is still different from what you expect, the problem must be in the filtering routine.