What methods do you use to bring the variable data from an external program or function into a guide GUI function file?

조회 수: 2 (최근 30일)
Pleae share the way you manage to bring the variables(which are updated in the external program/functions)from external program/functions into a matlab gui functions.
[Meaning the GUI function is defined in a seperate file and your main function is written in another file.]

채택된 답변

Ilham Hardy
Ilham Hardy 2016년 2월 24일
  1. Load required parameter into Matlab (base) workspace
  2. Use evalin() to load the specified parameter into the GUI.
  댓글 수: 2
Statisticalbeginner
Statisticalbeginner 2016년 2월 24일
Using assignin and evalin for GUIDE is a painful process. What if I want to update the variables received from the external function to automatically update inside a call_back function ? It doesnt work.
Stephen23
Stephen23 2019년 9월 5일
편집: Stephen23 2019년 9월 5일
"Using assignin and evalin for GUIDE is a painful process."
Which is why experienced MATLAB users do not recommend this method, nor use it themselves. As always, the most efficient way to pass data between workspaces is to use input/output arguments or nested functions.
The MATLAB documentation explains how to provide input/output arguments for GUIDE GUIs:
"What if I want to update the variables received from the external function to automatically update inside a call_back function"
You should revise your data-flow concept. Rather than making data appear in (and disappear from) other other workspaces, you should process the data within the GUI workspaces. This will be much simpler and more efficient.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by