MATLAB: Locating a cell from two inputs

cell arraysfindsearch table

if (Variable1 == 'B')
Variable3 = input('Please enter a date after 22/01/2020 in the format dd-mm-yyyy\n');
Variable4 = input('Please select a location to be analysed: China, UK, South Korea, Spain, Italy, USA\n ');
if (Variable4 == 'China')
readcell('dailytotal.csv', 'Variable3', 'China')
end
What would be the code required to take a user input of a date and a country and have it output the value from a table the corresponds to these two inputs?
I have the data in matlab as both a table and individual column vectors if that makes a difference.
I've included my attempt (it continues for the rest of the countries.)
I'm getting the error 'Unkown parameter 'Variable3'
Thanks

Best Answer

I see that you found the file and were able to open it!
Try something like this:
dailytotal = array2table(rand(5,3), 'VariableNames',{'Date','China','UK'});
Choose = listdlg('PromptString',{'Select a Country'}, 'ListString',dailytotal.Properties.VariableNames(2:end));
Country = dailytotal{:,Choose+1};
That makes referencing a particular column straightforward. (Use your own ‘dailytotal.csv’ file instead of my synthetic one that I used to test my code.)