clear Arduino as a global variable in Matlab
In the MatLab Help Center they had nice description of how to clear a variable from memory. Check it here: https://www.mathworks.com/help/matlab/ref/clearvars.html 

In your case should be: clearvars -global a;