uitable and use within a figure created with the function figure
62 views (last 30 days)
I have been attempting to use the function uitable to print a table on a figure generated with the "figure" command.
The table data is within the variable tableData and the function call is
figID = figure;
uitable( figID_Comb, 'Data', tableData, 'Position', [300, 400, 200, 300]);
When I use this call, I get the message
Error using uitable
Functionality not supported with figures created with the figure function. For more information, see Graphics
Support in App Designer.
The help information on the uitable functions states: uit = uitable creates a table user interface component in the current figure and returns the Table UI component object. If there is no figure available, MATLAB® calls the figure function to create one.
The error message and the help information are contradictory - I believe.
Sahithi Kanumarlapudi on 27 Jan 2021
As the error message suggests, 'uitable' cannot be used with figures created using 'figure' function.
I have brought the issue related to the help function on uitable to the notice of our developers. They will investigate the matter further.
Walter Roberson on 14 Dec 2021
There is no contradiction. The bit about creating a figure if none is available only applies if no parent is specified. You are supplying a parent.
After that you need to look at the details for the Data option, which says,
- Table array (uifigure-based apps only) — Displays any combination of data types that table arrays support, such as datetime, duration, and categorical.
You are not using a uifigure as the parent.
If there is a fault in the documentation it would be that in the case
uit = uitable(Name,Value) specifies property values of the table UI component using one or more name-value pair arguments.
that it does not explicitly repeat the bit about looking for a parent... in the syntax summary list.