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