Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to run script at startup of MATLAB

📅 2016-Feb-11 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

It is sometimes useful to run a MATLAB script when it is started. For example, to setup the environment just the way you want before you begin your work.

MATLAB supports this usage. When you start MATLAB from the shell, it looks for a startup.m script in the current directory and executes the commands in it after starting up. The directory from which MATLAB is started is called the MATLAB Startup Folder.

So, create a startup.m with the commands you need and run MATLAB from that directory.

Reference: startup

Tried with: MATLAB R2014a and Ubuntu 14.04