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: MCS.m
    path of file: ./repos/spectrum-sensing/lib/simulation
    
    the code of the file until where you have to start completion: function [Y,A,PU,n,Z,SNR] = MCS(scenario)

M = size(scenario.PU,1);                    % Number of PUs
N = size(scenario.SU,1);                    % Number of SUs

    
function [Y,A,PU,n,Z,SNR] = MCS(scenario)

M = size(scenario.PU,1);                    % Number of PUs
N = size(scenario.SU,1);                    % Number of SUs
txPower = scenario.TXPower*ones(M,1);       % Transmission power
noisePower = scenario.NoisePower*ones(N,1); % Gaussian noise power
a = 4;                                      % Path-loss exponent
samples = round(2*scenario.T*scenario.w);   % Number of samples
realiz = scenario.realiz;                   % Number of Monte-Carlo realizations

if (scenario.fading)
    fading = 'ray';
else
    fading = '';
end