MATLAB: Help urgent ! Error while evaluating uicontrol Callback

arduino

Hi ! Any idea why this is happening and how to fix it?
Thanks,

Best Answer

Your code relies upon Legacy Arduino, suitable for MATLAB R2011a to R2013b only. It calls upon install_arduino which is defined by that particular support package, and it uses pinMode(), which was replaced, as I discuss in https://www.mathworks.com/matlabcentral/answers/304583-no-appropriate-method-property-or-field-pinmode-for-class-arduino#answer_236196
Your code is not suitable for demonstrating any reasonably current version of MATLAB: it will fail for R2014a or later.
In the version range that it works for, your code would crash at the location it does if you have not first clicked on the STABILESTE CONEXIUENEA button to initialize the arduino connection. Your code will also have problems if you do not click on START as well.
Your code will fail when you click on START if you are not using a PC, as the code expects to be able to access the winvideo video adapter.