Inline equation in MATLAB Document object
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
The MATLAB RPT doc example shows how to put inline equation into a Report.
However, I am not using Report. I am just using Document. Can I do inline equation in a Document object?
Thanks
Kevin
0 件のコメント
回答 (1 件)
Rahul
2024 年 9 月 11 日
I understand that you wish to put an inline equation into a Report using the 'Document' function.
You can follow the following code to achieve the desired result:
import mlreportgen.dom.*;
% I am creating a 'docx' file here, you can change the extension according to your requirement
doc = Document('MyDocument', 'docx');
open(doc);
% Adding a 'Paragraph' with inline text and an equation 'Text'
para = Paragraph('Here is an inline equation: ');
eqText = Text('E = mc^2');
% Appending the equation 'Text' to the 'Paragraph' and the 'Paragraph' to the 'Document'
append(para, eqText);
append(doc, para);
You can refer to the following Mathworks documentations to know more about these functions:
'Paragraph': https://www.mathworks.com/help/releases/R2024a/rptgen/ug/paragraph.html?searchHighlight=Paragraph&s_tid=doc_srchtitle
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Function Creation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!