I don't have much experience with Matlab, but I work with some analysts who write R, which I gather is quite similar.
A good first step is to get on top of your external dependencies. I find analysts tend not to think about this too much and happily just stick in whichever library, which can be a problem when you're working with a team.
So, make sure that your code base uses exactly one version of each library and everyone develops against that version. Next, make sure you only have one external library to server each purpose.
The R equivalent I've seen is a codebase which included dplyr, plyr (obsolete version of dplyr), data.tables (does the same job as dplyr, but with gibberish syntax), along with reshape (obsolete), reshape2 (obsolete) and tidyr. This sort of thing happens really easily because people want to use the tools they're familiar with.
Working with R has also led me to believe that some languages are just bad for writing large programs in.
So you may have to consider either a rewrite in a different language, or a rewrite so that you have several smaller programs connected with a glue language (e.g. `make`).
Either way, the software engineering part of software usually goes "extract a piece of this program, put it in a box, define the entrances and exits from the box carefully, then ensure your box does what it's supposed to".
The hard bit is deciding which way to cut the program up. That can have big consequences.
A good first step is to get on top of your external dependencies. I find analysts tend not to think about this too much and happily just stick in whichever library, which can be a problem when you're working with a team.
So, make sure that your code base uses exactly one version of each library and everyone develops against that version. Next, make sure you only have one external library to server each purpose.
The R equivalent I've seen is a codebase which included dplyr, plyr (obsolete version of dplyr), data.tables (does the same job as dplyr, but with gibberish syntax), along with reshape (obsolete), reshape2 (obsolete) and tidyr. This sort of thing happens really easily because people want to use the tools they're familiar with.
Working with R has also led me to believe that some languages are just bad for writing large programs in.
So you may have to consider either a rewrite in a different language, or a rewrite so that you have several smaller programs connected with a glue language (e.g. `make`).
Either way, the software engineering part of software usually goes "extract a piece of this program, put it in a box, define the entrances and exits from the box carefully, then ensure your box does what it's supposed to".
The hard bit is deciding which way to cut the program up. That can have big consequences.