如何在matlab中显示表格的编程应用程序?

2025-10-14 02:22:06

1、f = figure('Position', [100 100 752 250]); 

如何在matlab中显示表格的编程应用程序?

如何在matlab中显示表格的编程应用程序?

2、t = uitable('Parent', f, 'Position', [25 50 700 200], 'Data', magic(10))

如何在matlab中显示表格的编程应用程序?

3、load patients LastName Age Weight Height SelfAssessedHealthStatus                                                                                 % load data

PatientData = [LastName num2cell([Age Weight Height]) SelfAssessedHealthStatus];                                                         % convert to cell array

t.Data = PatientData;

如何在matlab中显示表格的编程应用程序?

4、t.ColumnName = {'LastName', 'Age', 'Weight', 'Height', 'Self Assessed|Health Status'};

如何在matlab中显示表格的编程应用程序?

5、t.ColumnWidth = {100, 'auto', 'auto', 'auto', 150};

如何在matlab中显示表格的编程应用程序?

6、t.RowName = [];

如何在matlab中显示表格的编程应用程序?

7、t.Position = [15 25 495 200];

如何在matlab中显示表格的编程应用程序?

8、t.BackgroundColor = [.4 .4 .4; .4 .4 .8];   

t.ForegroundColor = [1 1 1];

如何在matlab中显示表格的编程应用程序?

9、t.ColumnEditable = [false true true true true];

如何在matlab中显示表格的编程应用程序?

10、t.ColumnFormat = {[] [] [] [] {'Excellent', 'Fair', 'Good', 'Poor'}};

如何在matlab中显示表格的编程应用程序?

11、t.CellEditCallback = @ageCheckCB;

function ageCheckCB(src, eventdata)

if (eventdata.Indices(2) == 2 && ...                  % check if column 2   

   (eventdata.NewData < 0 || eventdata.NewData > 120))  

 tableData = src.Data;   

tableData{eventdata.Indices(1), eventdata.Indices(2)} = eventdata.PreviousData;  

 src.Data = tableData;                 % set the data back to its original value  

 warning('Age must be between 0 and 120.')       % warn the user

end

end

如何在matlab中显示表格的编程应用程序?

12、get(t)

如何在matlab中显示表格的编程应用程序?

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢