oops - quits matlab if error, creates temp file, and prints info Usage: oops(errorcode) oops provides a centralized way to quit matlab and print a pre-defined error message based on a numeric error code. It uses the FS-FAST "qoe" function that quits matlab completely, even in non-interactive mode, so scripts can continue to run. The numeric values assigned to particular error msg are subject to change. If oops is passed an errorcode that doesn't have a corresponding error message, it prints "Undefined error." $Id: oops.m,v 1.3 2003/09/18 16:58:53 nknouf Exp $
This function calls:
This function is called by:
0001 function oops(errorcode) 0002 % oops - quits matlab if error, creates temp file, and prints info 0003 % 0004 % Usage: oops(errorcode) 0005 % 0006 % oops provides a centralized way to quit matlab and print a pre-defined error 0007 % message based on a numeric error code. It uses the FS-FAST "qoe" function 0008 % that quits matlab completely, even in non-interactive mode, so scripts can 0009 % continue to run. 0010 % 0011 % The numeric values assigned to particular error msg are subject to change. 0012 % If oops is passed an errorcode that doesn't have a corresponding error 0013 % message, it prints "Undefined error." 0014 % 0015 % $Id: oops.m,v 1.3 2003/09/18 16:58:53 nknouf Exp $ 0016 0017 global oopsfile; 0018 0019 msg = getmsg(errorcode); 0020 0021 fmri_touch(oopsfile); 0022 qoe(['ERROR ' num2str(errorcode) ': ' msg]); 0023 return; 0024 0025 %% returns a specific error message 0026 function msg = getmsg(errorcode) 0027 0028 switch (errorcode) 0029 case 150, 0030 msg = 'All arguments must be a string'; 0031 case 151, 0032 msg = 'Flag needs one argument'; 0033 case 152, 0034 msg = 'Hemodynamic volume is empty'; 0035 case 153, 0036 msg = 'Hemodynamic offset volume is empty'; 0037 case 154, 0038 msg = 'Hemodynamic h.dat file is empty'; 0039 case 155, 0040 msg = 'There was a problem converting the hemodynamic volume; ensure that you have the correct number of conditions'; 0041 case 156, 0042 msg = 'The computed number of samples is not an integer; ensure that you have the correct number of conditions'; 0043 case 157, 0044 msg = 'Functional data volume is empty'; 0045 case 158, 0046 msg = 'Unable to open file for writing'; 0047 case 159, 0048 msg = 'Unable to open file for reading'; 0049 case 250, 0050 msg = 'No voxels in the ROI'; 0051 case 251, 0052 msg = 'No voxels found when compacting the ROI'; 0053 case 252, 0054 msg = 'Please use more than one ROI'; 0055 case 253, 0056 msg = 'You have too many ROIs in your list. Please use two or three'; 0057 case 254, 0058 msg = 'Please use mosaic or a slice number for the \"display\" parameter'; 0059 case 255, 0060 msg = 'Threshold cannot be zero'; 0061 case 256, 0062 msg = 'File containing ROI names not found; perhaps there was a problem with combine_roi?'; 0063 case 350, 0064 msg = 'Both lindex and lyz are empty'; 0065 case 351, 0066 msg = 'lindex and lxyz have different lengths'; 0067 case 352, 0068 msg = 'lxyz does not have three columns'; 0069 case 353, 0070 msg = 'Length of lvals inconsistent'; 0071 case 950, 0072 msg = 'Problem computing the matrix intersection: size of A is not the same as size of B'; 0073 case 951, 0074 msg = 'Colormap not one of the supported types'; 0075 otherwise, 0076 msg = 'Undefined error'; 0077 end 0078 return;