Include lines of code
Include lines of code
(OP)
Hello ,
I am an absolute newbie at matlab, and have been tasked with making >10K lines of matlab code user friendly. This is incredibly spaghetti code and has a ton of settings changing in different arbitrary places. One way of making this more userfriendly that was suggested was to use separate files for each of the settings/variables and call these files every time i need those values.
I would like to know if there is a way to open a text file and essentially 'cut and paste' all its contents at a particular location in a .m file at execution time?
I am an absolute newbie at matlab, and have been tasked with making >10K lines of matlab code user friendly. This is incredibly spaghetti code and has a ton of settings changing in different arbitrary places. One way of making this more userfriendly that was suggested was to use separate files for each of the settings/variables and call these files every time i need those values.
I would like to know if there is a way to open a text file and essentially 'cut and paste' all its contents at a particular location in a .m file at execution time?





RE: Include lines of code
You can't normally, edit matlab code at execution time. If you are using the editor/debugger you can do copy and paste to another file, but can't cut out parts of the running program.
The best thing to do is to write down the lines numbers to cut out and do the cutting after the session end.
Joe
BSTEX - Equation viewer for Matlab
http://www.geocities.com/bstex2001