MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何在Matlab的多个表中插入多个图形? (https://www.labfans.com/bbs/showthread.php?t=26743)

poster 2019-12-14 20:46

如何在Matlab的多个表中插入多个图形?
 
这是我要在MATLAB中实现的目标:

第1页

______________ | | | | Fig1 | Fig2| | | | |______|_____| | | | | Fig3 | Fig4| | | | |______|_____| 第2页

______________ | | | | Fig5 | Fig6| | | | |______|_____| | | | | Fig7 | Fig8| | | | |______|_____| 我无法找出参数来传递InsertBreak以获得新页面:

word = actxserver('Word.Application'); word.Visible = 1; op = invoke(word.Documents,'Add'); active=word.ActiveDocument; %% Table 1 % Create 4x4 table range=word.Selection.Range; shapes=word.Selection.InlineShapes; t=invoke(word.ActiveDocument.Tables,'add',range,2,2); % fill each cell with an image, image will fit to table invoke(shapes,'addpicture',fullfile(pwd, 'fig1.wmf')); invoke(word.Selection,'moveright',1,1); invoke(shapes,'addpicture',fullfile(pwd, 'fig2.wmf')); invoke(word.Selection,'moveright',1,2); invoke(shapes,'addpicture',fullfile(pwd, 'fig3.wmf')); invoke(word.Selection,'moveright',1,1); invoke(shapes,'addpicture',fullfile(pwd, 'fig4.wmf')); %% Table 2, I want this on a new page invoke(word.Selection,'InsertBreak',2); % how do I get the next stuff on a new page? range=word.Selection.Range; shapes=word.Selection.InlineShapes; t=invoke(word.ActiveDocument.Tables,'add',range,1,2); invoke(shapes,'addpicture',fullfile(pwd, 'fig1.wmf')); invoke(word.Selection,'moveright',1,1); invoke(shapes,'addpicture',fullfile(pwd, 'fig2.wmf'));

[B]回答:[/B]

尝试以下方法代替您的InsertBreak行。它将选择的开始移动到文档的结尾。如果不采取行动,您的代码将在表单元格内插入分页符。

invoke(word.Selection, 'MoveStart', 6); invoke(word.Selection, 'InsertBreak');

[url=https://stackoverflow.com/questions/5467769]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 09:50

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.