Hi,
I want to generate the pdf file (not from pressing the publish button or by using the save as button) from script (.m or .mlx). Is there any way to do so?
Your reply would be appreciated.
Thanks in anticipation.

댓글 수: 7

Rik
Rik 2021년 12월 31일
If I open R2021a I don't see pdf listed as an option in the save-as dialog. Can you explain what your intended result would be?
Mujtaba Farrukh
Mujtaba Farrukh 2021년 12월 31일
Yes sir, you are right. Pardon me. I exactly want to generate a pdf from the code, like the file attached.
Rik
Rik 2021년 12월 31일
It isn't clear to me how that would derive from any Matlab code. Can you give an example m file with the corresponding pdf?
Mujtaba Farrukh
Mujtaba Farrukh 2022년 1월 1일
So, I want to write a code (.m script) that automatically generates a pdf report by taking these vectors as inputs
xls_inputs
xls_locals
xls_outputs
xls_cals
I have attached all the required material. Please do have a look.
So, the pdf made in code should look like the pdf attached.
Rik
Rik 2022년 1월 1일
편집: Rik 2022년 1월 1일
You will have to write something yourself. Why don't you ask the company that produced the file you attached?
I you aren't as strict, the publish function should actually get you most of the way there.
Mujtaba Farrukh
Mujtaba Farrukh 2022년 1월 1일
Sir, I need to convert the .mlx file (with its output evaluted and code) to pdf. I have used your guided method "publish", it works but for doc only. But as soon as I put pdf it says:
Error on line 25 column 91 of null:
Error reported by XML parser: An invalid XML character (Unicode: 0xffff) was found in the element content of the document.
Error using publish
.m file must contain valid XML 1.0 Standard characters.
Error in untitled (line 7)
publish('Out.mlx',options)
I have attached the files, you can have a try. Run the main file.
Mujtaba Farrukh
Mujtaba Farrukh 2022년 1월 1일
So, now, I have commented the T1 and T4. The program runs fine and generate PDF too. But the thing is there is a lot of difference between publish button pdf and publish function pdf. Is there any way to get the same pdf as the button do

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

 채택된 답변

Kevin
Kevin 2021년 12월 31일

0 개 추천

What about the MATAB function publish( )?

댓글 수: 2

Mujtaba Farrukh
Mujtaba Farrukh 2022년 1월 1일
yes I have checked, it function can help me. But can I make a formated pdf file, like the one I attached, from the script?
I am attaching the .m file that I want to convert in a pdf.
Kevin
Kevin 2022년 1월 1일
I believe the answer is yes. But in order to generate the PDF, you need MATLAB Report Generator (which is a toolbox).

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Adding custom doc에 대해 자세히 알아보기

제품

릴리스

R2021a

태그

질문:

2021년 12월 31일

댓글:

2022년 1월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by