Borrar filtros
Borrar filtros

Plot graph with a table of variables

5 visualizaciones (últimos 30 días)
Mario
Mario el 2 de Ag. de 2018
Respondida: KSSV el 2 de Ag. de 2018
I would like to plot some graph and in the same plot put the table of variables. Is it possible somehow to do that?

Respuestas (2)

Surbhi Pillai
Surbhi Pillai el 2 de Ag. de 2018
Hello,
I understand you are trying to include a table along with a plot within a figure. You can try using 'uitable' function to get the desired results.
Following is an example to do the same in MATLAB R2018a:
x=[1 2 3 4 5 6 7 8]';
y=[2 4 5 7 8 5 4 2]';
f=figure;
subplot(121);
plot(x,y);
data=[x,y];
colNames={'X-Data','Y-Data'};
t=uitable(f,'Data',data,'Position',[300,100,200,300],'ColumnName',colNames);
For further help with 'uitable' function kindly go through the documentation link uitable
Hope this helps...

KSSV
KSSV el 2 de Ag. de 2018
subplot(2,1,1);
plot(rand(10,1));
uitable('Data', rand(10,3), 'ColumnName', {'A', 'B', 'C'}, 'Position', [20 20 500 150]);

Categorías

Más información sobre Specifying Target for Graphics Output 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