How to store data values from uitable
Mostrar comentarios más antiguos
How would I go about storing data values typed into a uitable as globals or otherwise?
Respuestas (1)
Walter Roberson
el 16 de Ag. de 2013
DataCell = get(UitableHandle, 'Data');
global_variable_1 = DataCell{5,7}; %for example
8 comentarios
James Hendren
el 16 de Ag. de 2013
Walter Roberson
el 16 de Ag. de 2013
You display the content of the variable.
James Hendren
el 16 de Ag. de 2013
James Hendren
el 16 de Ag. de 2013
James Hendren
el 16 de Ag. de 2013
Walter Roberson
el 16 de Ag. de 2013
You initialize cell {1,2} to '', and then a line later you fetch the value out again, without giving an opportunity to the user to edit the value.
Also be sure that you
global DataCell
in the routine before you assign to DataCell if you want the variable to be global.
James Hendren
el 16 de Ag. de 2013
Walter Roberson
el 16 de Ag. de 2013
You should investigate the CellEditCallback property; see http://www.mathworks.com/help/matlab/ref/uitableproperties.html#brgcv4s
You would set it to the handle of a function; the function would execute when a cell is edited. In the function you would change the global variable.
You should consider alternatives.
Categorías
Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!