% create an arduino object. instead of "/dev/cu.usbmodem1411','BaudRate" % use your serail port name. You can check it in arduino -> tools -> port. % Write the name of your port before the command 'BaudRate' in the % following string. ar = serial('/dev/cu.usbmodem1411','BaudRate',9600); % Check for the camera name with the command % webcamlist() in matlab. cameras= webcamlist(); % type "cameras" in the command window and see which camera correspond