Exporting Matlab App Graphs
Show older comments
I have built an app using the Matlab App Designer. This app produces a couple of graphs on the screen, and now I want to export them to a PDF.
I am currently writing the code shown below. I am getting Error Uncrecognized method, property, or field 'UItable for class 'AnalyzerApp', where Analyzer app is the name of the app I am making.
For reference, path is the location that I want to save the pdf to.
exportgraphics(app.UItable, path)
exportgraphics(app.UItable2, path, 'Append', True)
exportgraphics(app.Axes, path, 'Append', True)
exportgraphics(app.Axes2, path, 'Append', True)
exportgraphics(app.Axes3, path, 'Append', True)
exportgraphics(app.Axes4, path, 'Append', True)
exportgraphics(app.Axes5, path, 'Append', True)
exportgraphics(app.Axes6, path, 'Append', True)
exportgraphics(app.Axes7, path, 'Append', True)
1 Comment
Asher
on 8 Jun 2023
Accepted Answer
More Answers (2)
Samay Sagar
on 8 Jun 2023
0 votes
4 Comments
Asher
on 8 Jun 2023
Samay Sagar
on 9 Jun 2023
Asher
on 9 Jun 2023
To save table as pdf you don't need to use exportgraphics func. You can use saveas func to store table as pdf. You should be able to use the generated pdf to store your graphs since they do have graphic content using exportgraphics. You can store table as pdf like this:
fig = figure('Name','Numbers');
t = uitable(fig,'Data',[2,4,6,8;1,3,5,7]);
saveas(gcf,'Numbers','pdf')
Simon Chan
on 11 Jun 2023
0 votes
It captures the screen according to the uitable position and put on a traditional figure. After that, use function exportgraphics to put it on a pdf file.
You may adjust the screen capture positions according to your own needs.
Attached an example for your reference.
Categories
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!