Report error line from a P-coded file

조회 수: 4 (최근 30일)
Kyle
Kyle 2023년 9월 18일
댓글: Kyle 2023년 9월 20일
The company I work for has a MATLAB based software product and we provide customers with a set of p-coded MATLAB files that they can run. Sometimes they run into issues but cannot send us their script because it is classified information. Is there a way to write out the line the error occured in inside the p-coded script? Ive tried using;
errMsg = sprintf('Error in line %d: %s', ME.stack(1).line, ME.message);
error(errMsg);
but when its converted to p-code, it outputs the error line as line 0.
  댓글 수: 2
Mario Malic
Mario Malic 2023년 9월 18일
I don't know anything about P-code, but can you output the error in the form of text document, so that they can forward the text file itself?
Kyle
Kyle 2023년 9월 20일
I've tried to, but it seems the p-coded file obfuscates the line info in ME.stack

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

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 9월 18일
You may consider Jan's proposed solution by creating a function file as given in this thread.
  댓글 수: 1
Kyle
Kyle 2023년 9월 20일
I'm not sure that solution fits my use-case. They have very specific criteria for each variable that can be checked.

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

카테고리

Help CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by