MATLAB: Am I receiving a “could not find external editor” error when using the “edit” command to open a MATLAB script

editeditorMATLABopenscriptunable

Whenever I try to open a script on a MacOS using the "edit" command, I receive an error that says "Could not find external editor". I'm able to open a script by clicking on it in the Current Folder window, and I can also make a new script with the button in the MATLAB editor. Only the "edit" command seems to not be working.
How can I get this to go away?

Best Answer

This error is likely appearing due to an invalid external editor being set in the preferences. This preference is not taken into account when manually clicking on a file to edit or when creating a new script, which is why you are only seeing the error when using the "edit" command.
You can change the default editor to MATLAB editor by navigating to:
Preferences -> MATLAB -> Editor/Debugger