Suppressed output after code error in publish

When I try to publish code that contains an example of a command that returns an error, the output for all code up to and including the error displays but all further code output is suppressed. For example, if I publish a file with this code in it,
3
error
3
the output shows the following for the first cell
ans =
3
Error using ==> error
Not enough input arguments.
Error in ==> cellToDebug at 3
error
but shows no output for the second cell (it does display the code). How do I get PUBLISH to continue displaying output after an error?

 채택된 답변

Oleg Komarov
Oleg Komarov 2011년 3월 2일

1 개 추천

The only way I found in the past is:
try sum(1:10,1:2); end
display(lasterr)
x = 1
A little ugly but it works
Oleg

댓글 수: 1

Andrew Newell
Andrew Newell 2011년 3월 2일
Thanks, Oleg. This isn't a bad solution because I just need to edit a few lines of the HTML to wipe out the ugliness.

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

추가 답변 (1개)

Andrew Newell
Andrew Newell 2011년 3월 3일

0 개 추천

I have submitted a bug report on this.
EDIT: The response from Matlab Support is that it's not a bug but inadequate documentation. This is exactly what they expect to happen. So Oleg's answer really is the best available.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by