You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: confmat.m
    path of file: ./repos/pcm/matlab/lib/netlab3_3
    
    the code of the file until where you have to start completion: function [C,rate]=confmat(Y,T)
%CONFMAT Compute a confusion matrix.
%
%	Description
%	[C, RATE] = CONFMAT(Y, T) computes the confusion matrix C and
%	classification performance RATE for the predictions mat{y} compared
%	with the targets T.  The data is assumed to be in a 1-of-N encoding,
%	unless there is just one column, when it is assumed to be a 2 class
%	problem with a 0-1 encoding.  Each row of Y and T corresponds to a
%	single example.
%
%	In the confusion matrix, the rows represent the true classes and the
%	columns the predicted classes.  The vector RATE has two entries: the
%	percentage of correct classifications and the total number of correct

    
function [C,rate]=confmat(Y,T)
%CONFMAT Compute a confusion matrix.
%
%	Description
%	[C, RATE] = CONFMAT(Y, T) computes the confusion matrix C and
%	classification performance RATE for the predictions mat{y} compared
%	with the targets T.  The data is assumed to be in a 1-of-N encoding,
%	unless there is just one column, when it is assumed to be a 2 class
%	problem with a 0-1 encoding.  Each row of Y and T corresponds to a
%	single example.
%
%	In the confusion matrix, the rows represent the true classes and the
%	columns the predicted classes.  The vector RATE has two entries: the
%	percentage of correct classifications and the total number of correct
%	classifications.
%
%	See also
%	CONFFIG, DEMTRAIN
%

%	Copyright (c) Ian T Nabney (1996-2001)

[n c]=size(Y);
[n2 c2]=size(T);

if n~=n2 | c~=c2
  error('Outputs and targets are different sizes')
end