필터 지우기
필터 지우기

Save output variables from uitable in the workspace

조회 수: 9 (최근 30일)
Joseba Moreno
Joseba Moreno 2019년 11월 29일
편집: Stephen23 2019년 12월 2일
Hi there,
I am facing some troubles when trying to save the updated values of my editable table into the workspace. The table is automatically updated and changes are saved in "ans". Here the script:
f = figure(1);
d = zeros(1, 7);
t = uitable(f,'Data',d,'ColumnWidth',{50},...
'ColumnEditable', [true true true true true true true]);
% GET DATA whenever the data change
set(t,'CellEditCallback','get(t,''Data'')');
So I would like to have a "real" variable which does the same as "ans". Is this possible?
Thanks in advance.

채택된 답변

Devineni Aslesha
Devineni Aslesha 2019년 12월 2일
Hi Joseba,
To save the updated values of the editable table into the workspace in the newData variable, use the below command.
set(t,'CellEditCallback','newData = get(t,''Data'')');
  댓글 수: 1
Stephen23
Stephen23 2019년 12월 2일
편집: Stephen23 2019년 12월 2일
Note also that the uitable documentation
states that providing a character vector for the callback function is "not recommended".
What exactly is "the workspace" ? Do you mean the function workspace or the base workspace?

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

추가 답변 (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