Hi Shehryaar,
I understand you are facing issue in building your file and also that you have tried reinstalling MATLAB.
To troubleshoot this issue, I recommend the following steps:
- Reinstall Simulink package, The Arduino IDE, and the Drivers for the Arduino.
- Uninstall and reinstall the Simulink add on as well as the MATLAB Support Package for Arduino Hardware, and the Simulink Support Package for Arduino Hardware
- Ensure the Arduino Board is not corrupted - check its appearance in device manager unser Ports(COM and LPT)
- Check if hardware connection are configured accurately by referring to https://www.mathworks.com/help/supportpkg/arduino/setup-and-configuration.html?s_tid=CRUX_lftnav
- Ensure MATLAB and Model File saved locally as none of the software should be on a network directory.
Hope this helps.