Report generation without rptgen

5 Ansichten (letzte 30 Tage)
Achyut
Achyut am 1 Feb. 2013
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!

Antworten (1)

Srinivas
Srinivas am 1 Feb. 2013
doc publish
http://www.mathworks.com/help/matlab/ref/publish.html
  2 Kommentare
Achyut
Achyut am 2 Feb. 2013
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 am 4 Feb. 2013
publish will generate report with plots if they are in the m-file.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by