Borrar filtros
Borrar filtros

uitable / string question

1 visualización (últimos 30 días)
Edward Umpfenbach
Edward Umpfenbach el 8 de Mayo de 2012
I create a uitable to capture a user input of strings.
global num_groups;
num_tech = uitable('Data',cell(1,num_groups));
temp = cell(1,num_groups);
for i = 1:1:num_groups
temp{1,i} = 'char';
end
set(num_tech,'ColumnEditable',[true(1,num_groups)],'ColumnFormat',temp);
I think it is pretty close to right because it left aligns, which I think a uitable with character inputs should do. Whatever string I type into the input cells is transformed into 'NaN'. What settin am I missing?

Respuestas (1)

Edward Umpfenbach
Edward Umpfenbach el 8 de Mayo de 2012
Looks like this is what uitable is designed to do.
From:
If your column is editable and the user enters a number, the number will be left-aligned. However, if the user enters a text string, the table displays a NaN.
What is the best way to prompt a user for a dynamic number of strings? (ie, whatever num_groups is, prompt for that many of strings).

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by