R2022a problem: Line number missing in error message sent to Command Window.

조회 수: 41 (최근 30일)
With R2022a, line numbers are sometimes omitted in error messages. Here's an example using a trivial script:
If I run the same script in R2021b, here's the result:
Weird. What's going on?
Is there a way to fix this in R2022a?
  댓글 수: 5
Scott MacKenzie
Scott MacKenzie 2022년 4월 22일
Yes, I think the problem is limited to tables. But, it goes beyond just referencing an unrecognized table variable. In the example below, the table variable exists. The error (reported without a line number) is in how the contents are accessed:
David Szwer
David Szwer 2022년 5월 17일
I get this problem too; also regarding tables, but a different error.
>> ProcessAll
Error using ProcessMovement
All tables being vertically concatenated must have the same number of variables.
Error in ProcessAll (line 10)
[moving, moveN] = ProcessMovement(filedir, 0);
Note that ProcessAll and ProcessMovement are both functions. Back in the day, Matlab wouldn't show line numbers at all if the error was in a script; this isn't a reversion to that behaviour, it is something different.

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

채택된 답변

Siddharth Bhutiya
Siddharth Bhutiya 2022년 5월 18일
편집: Adam Danz 2023년 10월 16일
Update: this bug was fixed in R2022a update 3 and in R2022b.
------------
This is a bug, thank you for reporting it! I have passed it along and it will be fixed in a future release.
As mentioned in the bug report, while this is being fixed, you could use MException.last.stack(1) to see the line number.
  댓글 수: 10
EFB
EFB 2023년 10월 15일
Unfortunately I experience a similar problem also in R2023b. I often use pre-defined error messsages as a tool for debugging, and for these the line numbers are not shown.
I.e.
if(ii == 4 && k == 200)
error('I want to make an error here')
end
produces the error message, but I dont get to see where in the code it is.
Jeremy P
Jeremy P 2024년 2월 15일
same here, I have this problem in R2023b everywhere I use the error function

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Preprocessing에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by