Insert two plots and a precreated table in the same figure
Mostrar comentarios más antiguos
Hello,
I have this code:
subplot(2,2,1)
yplot_balance = table2array(Tablecalc(:,6));
xplot_balance = table2array(Tablecalc(:,8));
plot(xplot_balance,yplot_balance, '.-')
xlabel('Fecha de cierre de la operación')
ylabel('Total equity')
grid on
subplot(2,2,2)
yplot_r = table2array(Tablecalc(:,5));
xplot_r = table2array(Tablecalc(:,8));
plot(xplot_r,yplot_r, '.-')
xlabel('Fecha de cierre de la operación')
ylabel('Resultado en Rs')
grid on
newfig = uifigure('name','Datos');
uit = uitable(newfig,'Data',Tablecalc, 'Position', [20 20 500 150]);
With that, so far I have been able to create plots in the same figure and insert a table to a separate figure.
However I am trying to insert in the plots' figure the table. The table has ints, doubles, strings and datetime values (I tried to convert it to an array or cells and did not work either).
In each method I have tried I get this error: Error using uitable Functionality not supported with figures created with the figure function. For more information, see Graphics Support in App Designer.
Some help please!
Respuesta aceptada
Más respuestas (1)
Peter Perkins
el 27 de Jul. de 2021
Camilo, in general you don't need all those table2array calls. Just do this:
plot(Tablecalc.NameOfYour6thVar,Tablecalc.NameOfYour8thVar, '.-')
If you really, really have a need to pull variables out of a table, do this:
yplot_balance = Tablecalc.NameOfYour6thVar
But chances are you don't need to do that.
1 comentario
Camilo Acevedo
el 27 de Jul. de 2021
Categorías
Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!