Loading Text Files to Run as the Commands in a Function
21 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
In one function I am writing/creating text files with a string of commands that I would like to then load in a different function and run each line from the text file. The text file is used to define variables, create server connections, and call other functions.
0 Commenti
Risposte (1)
Guillaume
il 10 Lug 2019
Ignoring the fact that running arbitrary code is rarely a good idea, the simplest way to achieve what you want is to save your text file with a .m extension and use run to execute that file within your other function.
0 Commenti
Vedere anche
Categorie
Scopri di più su Data Import and Export in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!