Report Generator; how to deal with special characters & indenting

조회 수: 4 (최근 30일)
Petra
Petra 2012년 10월 3일
답변: Riccardo Spica 2022년 7월 13일
Dear Matlab-Users
I'm currently working on a template file to generate pdf reports with ReportGenerator. The report summarizes user input from a GUI, and I face two problems. Any help is highly appreciated.
1. How to deal with special characters? Greek letters need to be included in the report and '\mu' does not work. Moreover, '\n' does not work to include line breaks in strings. 2. Is it possible to control the indenting? The system automatically sets massive indents at the beginning of new chapters and I wish to set it to zero.
Many thanks in advance.
Petra

답변 (1개)

Riccardo Spica
Riccardo Spica 2022년 7월 13일
Hi Petra,
for your first question, you could exploit the sprintf function.
You can refer to the "Special Character" section of the sprintf documentation here.
As an example,
sprintf('\x3B8')
ans = 'θ'
will print a \theta. You can find the unicode string of a specific symbol by using Windows Character Map.
Riccardo

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by