필터 지우기
필터 지우기

How to modify a variable with a gui?

조회 수: 9 (최근 30일)
Umberto Fontana
Umberto Fontana 2017년 12월 21일
답변: Ramnarayan Krishnamurthy 2017년 12월 28일
Hi, I'd like to create a matlab gui, in which through a button,I can change the value of a variable defined in the workspace. The problem is that i don't know how to pass the variable to the callback function, linked with the button.Thank you

답변 (1개)

Ramnarayan Krishnamurthy
Ramnarayan Krishnamurthy 2017년 12월 28일
In the callback function for the button, use the assignin function to modify the value in the base workspace.
For ex.
modified_value = 100;
assignin('base','var', modified_value);
where ' var' is the variable to be modified (assuming you know which variable in the base workspace has to be modified)

카테고리

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