From 65dc7ad2d25f94401081d63f828ba02d7f66bae9 Mon Sep 17 00:00:00 2001 From: cbsmith2 <cbsmith2@uab.edu> Date: Tue, 11 Mar 2025 10:22:13 -0500 Subject: [PATCH] Fixed missing and 1 file cases in the CheckmiscLS code, added missing newline character to CheckmiscLS code --- SaveTranscriptions.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/SaveTranscriptions.m b/SaveTranscriptions.m index 0e1d4e2..60c46fa 100644 --- a/SaveTranscriptions.m +++ b/SaveTranscriptions.m @@ -22,13 +22,17 @@ reviewerInit = input('Please enter your initials: ', 's'); % Save latest transcription and progress uisave({'lss', 'remainingFiles', 'reviewerInit'}, '*.mat') -% ['lss_' reviewerInit '.mat'] %% Functions function ls = CheckmiscLS(miscLS) -ls = []; -if isempty(miscLS); return; end + +if isempty(miscLS); error('No valid ls transcription file was found in the workspace. Please check that the file has been exported from the application.'); end +if length(miscLS) == 1 + ls = string(miscLS); + fprintf('Variable %s will be used as the user transcription variable.\n', ls) + return +end fprintf(2, 'Warning: multiple potential ''ls'' files were found in the work space. \n\n') @@ -45,10 +49,10 @@ while true userResp = input('Resp:'); if any(ismember(validResp, userResp)) - fprintf('%s has been selected.', lsNames(userResp)) + fprintf('%s has been selected.\n', lsNames(userResp)) break else - fprintf('%i is an invalid response.', userResp) + fprintf('%i is an invalid response.\n', userResp) end end -- GitLab