I have several matlab functions and one script that call those functions. Suppose that they are 'a.m' 'f1.m' 'f2.m' and 'f3.m'. The script 'a.m' must open the functions files when it is manually opened and the run command is used. How can I do that with scripting techniques?

  • $\begingroup$ I'm not sure I understand what you're asking. What prevents you from making them all functions? $\endgroup$ Commented Jul 24, 2014 at 23:52

1 Answer 1


I'm assuming you mean "open the functions for editing".


is actually a function:


So the script can either have a line

edit f1.m f2.m f3.m

or can programatically construct a cell array of strings

cstrFunctions = {'f1.m' 'f2.m' 'f3.m'}
  • $\begingroup$ This is what I was asking. I had some trouble searching for this. Thanks. If they are already opened how can I prevent it from being opened again within a cycle? $\endgroup$
    – Pedro R.
    Commented Jul 25, 2014 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.