I have written a script in MATLAB, where I am retrieving rows and columns from a table based on the WHERE clause. So far i manage to retrieve the data from the database table.
The problem is that i would like to allow the user to have the option of running another search to retrieve another set of data.
This is my code so far that i have and the script is called 'searchpdb'.
pdbSearch = input('Enter your PDB Code: ', 's')
curs = fetch(exec(conn, ['SELECT * FROM cath_2_wo_dup WHERE pdbcode = ' '''' pdbSearch '''']));
fprintf('Results Successful! \n');
results = curs.Data % prints the data out
% ----------------------
% User option to search again
% -----------------------
goAgain = input('Would you like to search for another pdb?', 's');
% if (goAgain = 'Yes')
if strcmp(goAgain, 'Yes')
searchpdb(); %runs this script again.
elseif strcmp(goAgain, 'No')
fprintf('\nBye!\n');
end
I have tried using 'questdlg', but it does not show the results of the data in the table after i have given the option to the user to run again.
I am doing this the wrong way, or is there another efficient way of doing it? Should the option of running the script again be in another script ?