Whether or not you can run MATLAB from a flash drive depends on your license type.
Individual or Designated Computer license
Individual or Designated Computer licenses are locked to the computer they are installed on. Therefore, MATLAB cannot be installed to a flash drive and run on a computer different than the one it was installed on.
Individual licenses with Login Named User (LNU) enabled
On some Individual licenses, you can forego the lock to a specific computer by connecting to the internet on launch. This is called Login Named User, or LNU for short. When using LNU your MathWorks account credentials will be used to verify your license. If you have enabled LNU on your license, you can install MATLAB on a flash drive and run MATLAB on any internet-connected computer.
License administrators can enable Login Named User on Individual licenses here:
Concurrent or Network Named User licenses
Concurrent or Network Named User licenses are not locked to the computer they are installed on, and instead communicate with a license server elsewhere on your network when launched to confirm the presence of a MATLAB license. Therefore, with this kind of license MATLAB can be installed on a flash drive and used on any computer which is on the same network as the license manager.
If you still need any further clarifications, I suggest reaching out to the MATLAB Installation and Licensing support team at Mathworks Support.
Hope this helps!