1
$\begingroup$

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?

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

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{:});
$\endgroup$
1
  • $\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. Jul 25 '14 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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