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: mlpClassPred.m
    path of file: ./repos/PRMLT/chapter05
    
    the code of the file until where you have to start completion: function [y, P] = mlpClassPred(model, X)
% Multilayer perceptron classification prediction
% logistic activation function is used.
% Input:
%   model: model structure
%   X: d x n data matrix
% Ouput:
%   y: 1 x n label vector

    
function [y, P] = mlpClassPred(model, X)
% Multilayer perceptron classification prediction
% logistic activation function is used.
% Input:
%   model: model structure
%   X: d x n data matrix
% Ouput:
%   y: 1 x n label vector
%   P: k x n probability matrix
% Written by Mo Chen (sth4nth@gmail.com).
W = model.W;
b = model.b;
T = length(W);
Z = X;
for t = 1:T-1
    Z = sigmoid(W{t}'*Z+b{t});
end