フィルターのクリア

How can I save output of anovan as PDF?

2 ビュー (過去 30 日間)
Kevin
Kevin 2018 年 11 月 29 日
編集済み: Adam Danz 2021 年 4 月 30 日
Matlabs anovan function outputs a cell array (tbl) that pops up as a table figure (except it doest appear to count as a figure)
[p,tbl] = anova2(___)
What I want to do can be achieved by clicking save as on the "figure" and changing the format to PDF and saving as 'E_231_ANOVA' (or whatever). However running my script on many files, this will not be an acceptable solution. I am aware of how to automate the saving of PDF figures, but this doesn't seem to work for saving this output table. Please help.
Using 2018b version on a Windows machine (in case that matters).
  1 件のコメント
liomsi liomsi
liomsi liomsi 2018 年 12 月 4 日
I have the same issue on Matlab 2017a under OSX

サインインしてコメントする。

回答 (1 件)

Adam Danz
Adam Danz 2021 年 4 月 30 日
編集済み: Adam Danz 2021 年 4 月 30 日
One option is to save the table variable to a text file using writecell but it will not maintain its format. It can, however, be read back in to Matlab very easily using readcell. That's demonstrated in this answer.
If you're using Matlab R2021a or later you can use formattedDisplayText to convert the table into a string that maintains its format which is demonstrated in this community highlight. The string can then be written to a text file using fprintf or another text writing function.
If the text file is going to be read by humans, the second option is best.
If the text file is going to be read back into Matlab, the first option is best.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by