How can I load data from a .m file into my GUIDE generated GUI then manipulate it

4 ビュー (過去 30 日間)
Ben
Ben 2014 年 4 月 24 日
コメント済み: Ben 2014 年 4 月 25 日
At the moment I am utilizing
uigetfile('*.m');
in a pushbutton callback in my GUI to prompt the user to import a .m file with stored variables.
What do I need to do to be able to import the variables so they may be used in the GUI functions?
My goal is to import ECG data, modify it to provide the desired values for the graphs, and then plot said data on multiple axes.
My issue is that when I try to refer to the "val" variable stored in the files, the GUI function does not recognize it. Any suggestions?
Thanks.

採用された回答

Image Analyst
Image Analyst 2014 年 4 月 24 日
Put your script into the function somewhere, such as a button callback or the openingfcn. Then see the FAQ if you want to share variables between different functions, because all variables are local unless you do something to make them not be: http://matlab.wikia.com/wiki/FAQ?title=FAQ&cb=5763#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
  1 件のコメント
Ben
Ben 2014 年 4 月 25 日
The framework file is awesome! Thank you for the response. It was very helpful.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by