How to insert image from my computer while report generation using mlreport?

조회 수: 1(최근 30일)
SRUSHTI KHATAU
SRUSHTI KHATAU 2021년 11월 18일
답변: yanqi liu 2021년 12월 1일
Hi,
I want to insert image in my report which is saved in my computer. I am unable to do that.
attaching code for reference
import mlreportgen.dom.*
import mlreportgen.report.*
rpt = Report('exampleReport', 'pdf')
im = Image(which('DLRB.png')); % DLRB.png is the image saved in matlab path only where the report will be saved
im.Width = '0.75in';
im.Height = '0.75in';
append(rpt, im);
close(rpt);
rptview(rpt)
  댓글 수: 2
SRUSHTI KHATAU
SRUSHTI KHATAU 2021년 11월 22일
Hello, thank you for replying. The error was in image. I resolved it by myself. But I would like to know about how to give Caption/title to formal table Can you please answer my other questions. I am stuck there

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

답변(1개)

yanqi liu
yanqi liu 2021년 12월 1일
yes,sir,may be use
import mlreportgen.dom.*
import mlreportgen.report.*
import mlreportgen.dom.*;
rpt = Document('exampleReport','pdf');
table = HTML('<table border="2"><tr><td>yes,sir</td><td>!</td></tr><tr><td>yes,sir2</td><td>!</td></tr></table>');
append(table,'<p>here is a test</p>');
append(rpt,table);
close(rpt);
rptview(rpt.OutputPath);

Community Treasure Hunt

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

Start Hunting!

Translated by