How do I use exportgraphics function to save anova2 table in pdf?

9 ビュー (過去 30 日間)
Jared Kimble
Jared Kimble 2022 年 6 月 1 日
回答済み: Ayush 2023 年 8 月 31 日
SwAnova = anova2(SwingAandV,1);
exportgraphics(figure(1),"PlotsnCharts.pdf")
I am confused as to how I would word this to save an anova table or if it is even possible for tables so I can save multiple figures at once.

回答 (1 件)

Ayush
Ayush 2023 年 8 月 31 日
Hi Jared,
I understand that you want to export your anova2 table into a pdf file. Additionally, you also want to export multiple such tables at once in a single pdf.
It can be done in the following manner:
1. Create a figure that would be used by the uitable function as parent to create the GUI table using the “anova2” table data. You can refer to the below documentation to know more about the “uitable” function:
2. After the creation of this figure, use the “print” function to capture this figure handle as an image. You can refer to the below documentation to know more about the “print” function:
Here is a sample code for your reference:
% Capture the table as an image
tableImage = print(gcf, '-RGBImage');
3. Create a new figure to capture the image using the imshowfunction
created from the anova2 table. You can refer to the below documentation to know more about the “imshow” function:
Here is a sample code for your reference:
% Create a new figure for the table image
figure(2)
imshow(tableImage)
4. Use the exportgraphics function to save the figure containing the image i.e.figure(2)”.
5. To export multiple such figures, you can iterate over each anova2 table data to capture them as image and then saving these image figures into a pdf. The “append” property of the “exportgraphics functions needs to be set true” to save multiple figures in a single pdf.
Hope it helps,
Regards,
Ayush Misra

カテゴリ

Help Center および File ExchangeAnalysis of Variance and Covariance についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by