# Open several dependent functions in matlab with scripting

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?

• I'm not sure I understand what you're asking. What prevents you from making them all functions? – Geoff Oxberry Jul 24 '14 at 23:52

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

edit


is actually a function:

edit(varargin)


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'}
edit(cstrFunctions{:});

• 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? – Pedro R. Jul 25 '14 at 15:53