In my understanding you are trying to figure out which Arduino board is connected to a machine with your GUI.
The command
a = arduino()
tries to create an arduino object with the latest arduino board settings used. Instead you may consider using this command construct
a = arduino(port,board)
for creating an arduino object with different board settings.
In your callback function 'pushbutton1_Callback', you may consider creating a cell array consisting of supported boards and try to create objects in a loop in order to detect one successfully. You may want to use try and catch statments.
Please refer to the arduino documentation page for a list of supported boards