MATLAB: Store and Retrieve simple text box content using GUI

MATLABmatlab gui

Dear users
I have a question about store and retrieve IDs and names by using matlab , following my simple GUI and there are only two (text box 1 , text box 2) when i entered some authors names along with its ids ,
then for search purpose I need to enter only the ID then when i press search will retrieve the name correspond to that id , is there any way to do that i will thank any one can help me in this manner ..

Best Answer

doc containers.map
should help with this if your IDs are not guaranteed to be contiguous and starting from 1. There are examples in the help and using numeric indices is very easy anyway. It has the advantage over an array that your indices can be any numeric (or string) value.
If you are struggling with the underlying GUI aspect of it then that is a different matter, but a containers.Map object should work well to store all your data, assuming IDs are unique which seems a safe assumption given you are searching based on them.