I have a very long code that I'd like to break it up into files.
I have a main file, called main.m
inside the main.m, I have
- inside ini.m is all the variables to be initialized - and these values can change depending on the scenario.
- inside calculation1.m is basically calculating using the variables initialized to create a traffic
- inside calculation2.m is the heart of the program - does the simulation based on calculation1.m and ini.m
- inside report_plot.m uses the results from the calculations2.m to report the results in a plot, may use ini.m
In reality, I have tons more files, which is why I'm asking for help in project management.
The issue here is that the variables are not being shared from one file to another. Not sure if creating a global variable is the best solution.