Any way to get "Invalid or deleted object" error message to include which object was invalid?

조회 수: 2 (최근 30일)
Example:
Invalid or deleted object.
Error in * (line 70)
AB.w = obj2.w*obj1.w - dot(obj2.v, obj1.v);
It would be useful to know if AB, obj2, obj1, or one of the associated properties is the deleted object without having to go into the debugger. I believe MATLAB should know which object it errored out trying to access, so is there a way to get MATLAB to tell me this info?
  댓글 수: 5
Image Analyst
Image Analyst 2018년 12월 12일
Send a feature enhancement request to them. Several years ago we'd simply get an "index out of bounds" error if you tried to access m(9) when m had only 5 elements. Now the error message is more explicit and tells us what index you tried to access and the length of the vector, so it is possible to have improved error messages.
Grant Junno
Grant Junno 2018년 12월 12일
Wanted to make sure I wasn't missing an option to accomplish this before making a request. Glad to know such requests have been handled well in the past, too.

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

채택된 답변

Image Analyst
Image Analyst 2018년 12월 12일
Set a breakpoint there, at that line. Then hover the cursor over obj1 and obj2. If they are defined, you'll see a pop up with their value, and you'll see them listed in the workspace panel. If they are not defined, there will be no popup upon hovering, and no variable listed in the workspace panel.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by