Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include lines of code

Status
Not open for further replies.

Guest
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?
 
Replies continue below

Recommended for you

Hi,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor