Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getSnapshotImage

Class: mlreportgen.report.Equation
Package: mlreportgen.report

Create equation image path

Syntax

imgpath = getSnapshotImage(equation,report)

Description

imgpath = getSnapshotImage(equation,report) creates an image file containing the formatted equation and returns a path to the image file.

Input Arguments

expand all

Equation reporter object, specified as an mlreportgen.report.Equation object.

Report, specified as a report object. To create the report input, use mlreportgen.report.Report.

Output Arguments

expand all

Path of file containing the equation image, returned as a string. The image file is a scalable vector graphics file of type .svg for HTML and PDF output on all platforms. The image type is .emf for docx output on Windows and .png for docx output on Linux® and Macintosh.

Examples

Create a Left-Aligned, Numbered Equation

import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report('equation','html');
ch = Chapter('Title','Equation');
eq = Equation('\int_{0}^{2} x^2\sin(x) dx');
eq.FontSize = 12;
p = Paragraph('Eq 1: ');
p.Bold = true;
eqImg = Image(getSnapshotImage(eq,rpt));
t = Table({p,eqImg});
add(ch,t);
add(rpt,ch);
close(rpt);
rptview(rpt);

Introduced in R2017b

Was this topic helpful?