This extension provides support for editing and running MATLAB® code in Visual Studio® Code and includes features such as syntax highlighting, code analysis ...
Fortunately, Visual Studio Code has a little terminal you can use to run commands without needing to swap between windows.