Thanks for getting back to me.
So this didn't work for me because it kind of opens matlab from the terminal. Then I struggle to get out and run the rest of my scripts that need the initialization script before that.
How I solved it was buy writing a m file that just called main so:
main_called.m literally just has:
main
