Can you make an empty table that allows the user (through an app) to graphically click on a cell and input either a string or a double?

조회 수: 3 (최근 30일)
I am trying to make a uitable that will enable users to click on a cell and input either a char or a double value.
I created a table which allows me to programatically enter different types of data in each table element and then verify that the data type is what it should be. This shows that I can easily make a table with different variable classes, but I can NOT figure out how to do this using a uitable that a user can interact with and click on any cell within the table and input either a char or double.
After reading several other posts it seems like there is no offical way to make an "empty" table, but that is in essence what i need. A table that is a certain size and allows the user to define what class of data they input to each cell. Or is this simply not possible with matlab and I should consider different methods.
%% Create Figure
%f=figure;
%% Create uitable
g=uitable();
% Creating First Row
g.Data{1,1}='imsharpen';
g.Data{1,2}='Amount';
g.Data{1,3}=1;
g.Data{1,4}='Radius';
g.Data{1,5}=20;
% Creating First Row
g.Data{2,1}='imsharpen';
g.Data{2,2}='Amount';
g.Data{2,3}=1.5;
g.Data{2,4}='Threshold';
g.Data{2,5}=0.01;
%% Checking variable types
Row1_1=g.Data{1,1};
Row1_2=g.Data{1,2};
Row1_3=g.Data{1,3};
whos Row1_1 Row1_2 Row1_3
Name Size Bytes Class Attributes Row1_1 1x9 18 char Row1_2 1x6 12 char Row1_3 1x1 8 double

답변 (1개)

chicken vector
chicken vector 2023년 5월 12일
Are you looking for something like this?

카테고리

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

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by