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: cropMatrix.m
    path of file: ./repos/ciatah/+ciapkg/+image
    
    the code of the file until where you have to start completion: function [inputMatrix, coords] = cropMatrix(inputMatrix,varargin)
	% Crops a matrix either by removing rows or adding NaNs to where data was previously.
	% Biafra Ahanonu
	% 2014.01.23 [16:06:01]
	% inputs
		% inputMatrix - a [m n p] matrix of any class type
	% outputs
		% inputMatrix - cropped or NaN'd matrix, same name to reduce memory usage
	% changelog
		% 2017.01.14 [20:06:04] - support switched from [nSignals x y] to [x y nSignals].
		% 2021.04.18 [14:42:53] - Updated to make imrect the default method of selecting the coordinates.
		% 2021.08.08 [19:30:20] - Updated to handle CIAtah v4.0 switch to all functions inside ciapkg package.
		% 2021.09.28 [10:37:12] -
    
function [coords] = getCropCoords(thisFrame,options)
	import ciapkg.api.* % import CIAtah functions in ciapkg package API.

	figure(options.figNo);
	subplot(1,2,1);
	imagesc(thisFrame);
    axis image;
    colormap parula;
    title('Select a region. Double click region to continue.')
    box off;

	% Use ginput to select corner points of a rectangular
	% region by pointing and clicking the subject twice
	p = ginput(2);

	% Get the x and y corner coordinates as integers
	coords(1) = min(floor(p(1)), floor(p(2))); %xmin
	coords(2) = min(floor(p(3)), floor(p(4))); %ymin
	coords(3) = max(ceil(p(1)), ceil(p(2)));   %xmax
	coords(4) = max(ceil(p(3)), ceil(p(4)));   %ymax

	% Index into the original image to create the new image
	thisFrameCropped = thisFrame(coords(2):coords(4), coords(1): coords(3));

	% Display the subsetted image with appropriate axis ratio
	figure(9);subplot(1,2,2);imagesc(thisFrameCropped); axis image; colormap gray; title('cropped region');drawnow;
end