-1

this might be silly, Is there any way to automatically place a debug point when an error pops up in MATLAB

Error popping is done manually by

msg = 'Error has occurred'

error(msg)

What I need is, to automatically put a debug (not by manual intervention) after popping this error.

2
  • 1
    Do you want the program to pause in debug mode when any error occurs? Or do you want to set a debug breakpoint when an error occurs, so that next time it will pause there? Commented Jun 13, 2020 at 20:04
  • debug breakpoint at the line of error or before the line of error Commented Jun 13, 2020 at 20:41

1 Answer 1

1

You can use dbstop with a condition:

dbstop if error

MATLAB pauses at any line in any file when the specified condition occurs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.