MATLAB Publish freezes/hangs when writing multiple sections

I am adding some Notes in a MATLAB file and want to publish it as an HTML or PDF like this -
with this code section
....
load coor_list.dat
% --- Beinhaltet die Informationen über die Phänomenologie der EHS --------
%%
% <html>
% <span style="color:red;font-weight:bold">This line...!</span>
% </html>
laser = 'EHS_Lame_Parameter_1.dat'; %-> Lame curves appproximation...
....
OR this publish like this -
with this code section
....
load coor_list.dat
% --- Beinhaltet die Informationen über die Phänomenologie der EHS --------
%%
% *This line...!*
laser = 'EHS_Lame_Parameter_1.dat'; %-> Lame curves appproximation...
....
Now the problem arises when I am doing this with multiple section. MATLAB hangs while publishing when there are around 80 sections.
Is this beacuse of the number of sections or there could be some other issue? How can I check if there is some other issue?
Could there be a problem because of existing comment lines preceeding/succeeding the sections?

댓글 수: 7

I don't have any suggestions regarding the issue you describe, but I do have a remark about your code:
To 'poof' variables in your workspace with this syntax is not recommended, since it is unclear where variables will come from. Loading to a struct instead allows you to track where each variable comes from and where it is used. This will also prevent overwriting variables when you don't expect it.
Can anyone help me in this regard?
Hi
Could you please provide more information about sections like what's inside those sections.
....
load coor_list.dat
% --- Beinhaltet die Informationen über die Phänomenologie der EHS --------
%%
% <html>
% <span style="color:red;font-weight:bold">This line...!</span>
% </html>
laser = 'EHS_Lame_Parameter_1.dat'; %-> Lame curves appproximation...
%%
....
The section looks like this. I have shared this earlier in my main post as well.
This works only when I have one or two such sections. But when I am adding the same section multiple times in the code, the HTML does not get published and the 'publish' command hangs!
Hi @Sachin, do you have any idea about this issue?
Sachin
Sachin 2023년 3월 20일
편집: Sachin 2023년 3월 20일
Could you please provide the code in which you are facing this issue?
Hi @Sachin,
The .m file is contains code that I cannot share publically here.
I am inserting the comment sections before ^ after every line I want to put a comment on, in tis fashion-
%%
% <html>
% <span style="color:red;font-weight:bold">This line...!</span>
% </html>
laser = 'EHS_Lame_Parameter_1.dat'; %-> Lame curves appproximation...
%%
Or for better understanding-
%%
% <html>
% <span style="color:red;font-weight:bold">This line...!</span>
% </html>
Some line of code
%%
And this gives an expected output as well (see images in the original post) but only when I do this once or twice in the entire code.
When I insert comment sections in this fashion for 80 lines, then it hangs while publishing it.
I am not writing comment sections in any different way. Consider the above example for one line and replicate it for another 80 lines in a code. This is what I am doing.

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

 채택된 답변

Atin
Atin 2023년 5월 4일
Hi everyone,
I had contacted Matlab Technical Support team on this matter a nd have shared the files with them.
They investigated and found the issue does not occur when the code is not published and have suggested the workaround as follows-
publish('MatFile.m', 'evalCode',false)

추가 답변 (1개)

Piyush Dubey
Piyush Dubey 2023년 5월 4일

0 개 추천

Hi Atin,
While trying to publish sections to pdf or html format, multiple sections of data being loaded occupies systems resources causing system crash and glitches. Publishing the file section-wise may help avoid the crash.
For more information on various output preferences, you can refer to the following documentation:

댓글 수: 1

How would you publish a file section-wise? I am having publish hang as well, for a script with a for loop. I have never had this problem before and we have very many long simulations in our code base.

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

카테고리

도움말 센터File Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

제품

릴리스

R2022b

질문:

2023년 1월 23일

댓글:

2023년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by