I have incorporated a "breakpoint-like" feature in my code that opens a dialogue box to ask the user if the background removal/peak finding is satisfactory. If I am unsatisfied and select "cancel" it functions like a breakpoint whereas if I am satisfied and select "continue" it evaluates the next section of code.
promptMessage = sprintf('Satisfied with Background/Etalon Removal?,\nor Cancel to abort processing?');
button = questdlg(promptMessage, 'Continue', 'Continue', 'Cancel', 'Continue');
if strcmpi(button, 'Cancel')
This works well, but has the annoying feature that I have to manually scroll to the section where the relevant parameters are defined in order to change them (after changing them I re-run that section of code). Is there a way to programatically scroll the editor to a specific section of code if I select "cancel" (ie: unsatisfied)? The most useful approach would be to have a unique tag in the code for the desired line number as opposed to just scrolling to a specific line number because line numbers will change as I add/remove sections in the future.
Thanks in advance!