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: cca.m
    path of file: ./repos/MataveID/matave/+mi
    
    the code of the file until where you have to start completion: % Canoncial Correlation Analysis
% Input: u(input signal), y(output signal), k(Hankel row length), sampleTime, delay(optional)
% Output: sysd(Discrete state space model), K(Kalman Gain matrix)
% Example 1: [sysd, K] = mi.cca(u, y, k, sampleTime);
% Example 2: [sysd, K] = mi.cca(u, y, k, sampleTime, delay);
% Example 3: [sysd, K] = m
    
function [U1, S1, V1, nx] = modelReduction(U, S, V, systemorder)
  % Plot singular values
  stem(1:length(S), diag(S));
  title('Hankel Singular values');
  xlabel('Amount of singular values');
  ylabel('Value');

  if(systemorder == -1)
    % Choose system dimension n - Remember that you can use modred.m to reduce some states too!
    nx = inputdlg('Choose the state dimension by looking at hankel singular values: ');
    nx = str2num(cell2mat(nx));
  else
    nx = systemorder;
  end