Matlab の私のコードは、計算後に結果を単語で出力します。これには writetoword.m を使用しています。結果は主にテーブルに関するものです。これらの表の配置について助けが必要です。
FileSpec = fullfile(CurDir,[WordFileName,'.pdf']);
[ActXWord,WordHandle]=StartWord(FileSpec);
WordCreateTable(ActXWord,NoRows,NoCols,readings,6);
function WordCreateTable(actx_word_p,nr_rows_p,nr_cols_p,data_cell_p,enter_p)
if(enter_p(1))
actx_word_p.Selection.ParagraphFormat.Alignment=1;
actx_word_p.Selection.TypeParagraph;
end
actx_word_p.Selection.ParagraphFormat.Alignment=1;
actx_word_p.ActiveDocument.Tables.Add(actx_word_p.Selection.Range,nr_rows_p,nr_cols_p,2,1);
for r=1:nr_rows_p
for c=1:nr_cols_p
actx_word_p.Selection.ParagraphFormat.Alignment=1;
WordText(actx_word_p,data_cell_p{r,c},'Normal',[0,0]);
if(r*c==nr_rows_p*nr_cols_p)
actx_word_p.Selection.MoveDown;
else
actx_word_p.Selection.MoveRight;
end
end
end
end
function WordText(actx_word_p,text_p,style_p,enters_p,color_p)
if(enters_p(1))
actx_word_p.Selection.TypeParagraph;
end
actx_word_p.Selection.Style = style_p;
if(nargin == 5)
actx_word_p.Selection.Font.Color=color_p;
end
actx_word_p.Selection.TypeText(text_p);
actx_word_p.Selection.Font.Color='wdColorAutomatic';
for k=1:enters_p(2)
actx_word_p.Selection.TypeParagraph;
end
set(actx_word_p.Selection.ParagraphFormat,'Alignment',1);
end
すべての表を 1 枚のシートに印刷したいのですが、表を並べて表示する必要があります。上記のコードでは、常に新しい行で始まります。これどうやってするの?