insert multiple images in a line, matlab report generator

7 ビュー (過去 30 日間)
yogev gabay
yogev gabay 2016 年 8 月 25 日
編集済み: Paul Kinnucan 2016 年 10 月 6 日
view(0,0); %xz, toward inf y saveas(gcf,'pic.bmp'); imageObj = Image(strcat(cd,'\pic.bmp')); imageObj.Width = '5cm'; imageObj.Height = '3.75cm'; image1 = append(docObj,imageObj);
i want to insert 3 images i a row, but after each append, it goes to next line (line feed and carriage return).
how can i insert 3 images in a row?

回答 (1 件)

Paul Kinnucan
Paul Kinnucan 2016 年 10 月 6 日
編集済み: Paul Kinnucan 2016 年 10 月 6 日
Use an invisible table to lay out images side-by-side:
import mlreportgen.dom.*
imgPath = which('b747.jpg');
nImages = 3;
images = cell(1,nImages);
for i = 1:nImages
img = Image(imgPath);
img.Style = {ScaleToFit};
images{i} = img;
end
d = Document('sidebysideimages', 'pdf');
t = Table(images);
t.Border = 'none';
t.TableEntriesInnerMargin = '5pt';
append(d, t);
close(d);
rptview(d.OutputPath);

Community Treasure Hunt

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

Start Hunting!

Translated by