Report generation without rptgen

8 次查看(过去 30 天)
Achyut
Achyut 2013-2-1
Hello, I'm running a program on R2012a that gives me various outputs in the form of plots and text. I need these to be documented in a report (preferably .doc or .pdf). What i need basically is that when i run the program, a word doc or pdf must open in the end, that includes all the results. It need not be saved in a pre-defined location; the user can save it anywhere he wishes to. I do not have Report Generation, so is there a code that can do this?
I do know the code to create a new word doc with some text and figures that are already stored in a folder.
% % --- Generate report.
%%Start Microsoft Word
Word_COM = actxserver('Word.Application');
set(Word_COM,'Visible',1);%Make Word visible
% Create a document
File_COM = Word_COM.Documents.Add;%Creates a new document
% Add some text
Word_COM.Selection.TypeText('Test');
Word_COM.Selection.TypeParagraph;
Word_COM.Selection.InlineShapes.AddPicture('D:\Plots\figure1.fig');
Word_COM.Selection.MoveRight(1);
Word_COM.Selection.TypeParagraph;
I am able to save the plots into a folder, but when i try to import them into the word doc, they appear just as a box which says "Image can't be displayed". Maybe this is because they get saved in the standard matlab .fig format. However, even if i can get the plots right, i cannot enable the code to import text, unless i myself type it within those quotes (Word_COM.Selection.TypeText('*Test*');), which is not what i want!
Anyways, if someone knows how it can be done, i would be grateful!

回答(1 个)

Srinivas
Srinivas 2013-2-1
doc publish
http://www.mathworks.com/help/matlab/ref/publish.html
  2 个评论
Achyut
Achyut 2013-2-2
Thank you for the reply, but 'publish' merely generates a document of the m-file. However, I require that the results of the m-file be displayed in the document, and not just the code.
Srinivas
Srinivas 2013-2-4
publish will generate report with plots if they are in the m-file.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by