How to run a outside function inside a GUI m file?

Kindly looking for help. Thank you very much.
I have created a GUI named "marchtry"
function varargout = marchtry(varargin)
I wanna run a outside function (m-file) named "config.m" in the GUI m-file
[dio0, ain0, aout0] = config('test2.cal')
If I put the above line in the GUI m-file, it was not working. "config.m" is a configuration file for data acquisition. dio0, ain0, aout0 are all device objects and test2.cal is a txt file which need to be opened in "config".
Thank you.

 采纳的回答

Hi,
most often it's one of the following:
  • config.m is in another folder (if so, add the folder to the MATLAB path using "pathtool".
  • Or at the point in your GUI where you call config.m, there is some variable named config already assigned. If so, rename the variable so that it does not shadow the function config.m
In either case: "not working" is rather vague, some error message would help diagnose ...
Titus

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Simultaneous and Synchronized Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by