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: pspm_review.m
    path of file: ./repos/PsPM/src
    
    the code of the file until where you have to start completion: function varargout = pspm_review(varargin)
% ● Description
%   pspm_review is the MATLAB code for pspm_review.fig
% ● History
%   Introduced in PsPM 3.0
%   Written in 2008-2015 by Gabriel Graeni (University of Zurich)
%   Maintained in 2022 by Teddy Chao (UCL)

%% Initialise
global settings
if isempty(settings)
  pspm_init;
end
sts = -1;
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
  'gui_Singleton',  gui_Singleton, ...
  'gui_OpeningFcn', @pspm_review_OpeningFcn, ...
  'gui_OutputFcn',  @pspm_review_OutputFcn, ...
  'gui_LayoutFcn',  [] , ...
  'gui_Callback',   []);
if nargin && ischar(varargin{1})
  gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
  gui_mainfcn(gui_State,
    
function buttonPlot2_Callback(hObject, ~, handles)
% hObject    handle to buttonPlot2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
tmpStatusString = get(handles.textStatus,'String');
set(handles.textStatus,'String','Plotting is in progress. Please wait...');
switch handles.modelData{handles.currentModel}.modeltype
  case 'glm'
    handles.modelData{handles.currentModel}.fig = ...
      pspm_rev_glm(handles.modelData{handles.currentModel}.modelfile, ...
      handles.modelData{handles.currentModel}.model, 2);

  case 'dcm'
    sessionNr = checkSessionNr(handles);
    if sessionNr
      maxTrialNr = numel(handles.modelData{handles.currentModel}.model.sn{sessionNr}.u);
      trialNr = str2double(get(handles.editTrialNr,'String'));
      if isempty(trialNr) || trialNr > maxTrialNr || trialNr < 1
        uiwait(msgbox(sprintf('Trial number has to be within the range [1 - %d]',maxTrialNr),'Warning'));
      else
        pspm_rev_dcm(handles.modelData{handles.currentModel}.model, 'inv', sessionNr, trialNr);
      end