how to open an .m file with a dialog box

5 views (last 30 days)
Hi, is it possible to open a file from a dialog box as if you were calling from the command window? Specifically, I need to load some variables to use in a GUI from an .m file in a specific directory. I'm going crazy!
  3 Comments
Alessandro Sardelli
Alessandro Sardelli on 5 Mar 2015
I wish to open a .m file containing a script (a=1; b=2; ...); I declared all the variables in the file as global, so I can use it in other functions
Adam
Adam on 5 Mar 2015
Why don't you just have your script save the variables in a .mat file then you can load that wherever you want?

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 5 Mar 2015
open foo.m
Or
edit foo.m
  3 Comments
Sean de Wolski
Sean de Wolski on 5 Mar 2015
Perhaps, you mean:
doc run
To run it (not "open" it).
Alessandro Sardelli
Alessandro Sardelli on 6 Mar 2015
the command run work nice. thank you!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!