I am mkaing a report in MATLAB and want to make headrs and footers

조회 수: 18 (최근 30일)
Katherine
Katherine 2025년 11월 20일 10:42
댓글: Taylor 2025년 11월 21일 14:51
I am generating a word document in MATLAB without a template, and I want to make the headers and footers. I can only find information online about using holes in a dotx but I don't have dotx and therefore no holes, is there an actual command that inserts headers and footers?

채택된 답변

Taylor
Taylor 2025년 11월 20일 18:36
  댓글 수: 2
Katherine
Katherine 2025년 11월 21일 9:06
Thanks Taylor but when I try to use this it wants a template path to be able to fill them in,and I can't get it to work without a template
Taylor
Taylor 2025년 11월 21일 14:51
Try this
import mlreportgen.dom.*;
d = Document("MyReport","docx");
open(d);
% Create a header for the current section
header = DOCXPageHeader();
para = Paragraph("Header content here");
para.Bold = true;
append(header, para);
% Attach the header to the current page layout
d.CurrentPageLayout.PageHeaders = header;
% Add report content as usual
append(d, Paragraph("Main body content here"));
close(d);
rptview(d.OutputPath);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Report Generator Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by