I realise that this has been brought up before; but I am hoping that someone can clarify something for me. One of my variables is being calculated as a negative number at some point during my model run..however, this is a mistake (they can only be positive numbers). So I need to locate where this is happening a trace where the source of error is being produced.
The model is too large to do this manually, so I was hoping to use dbstop in some guise. I realise from reading the posts here that it is not simply a case of giving a condition (dbstop in test.m if var<0); so I was hoping to use a conditional if statement to display an error (disp 'error'), which I could use in: dbstop in test.m if error. However; what I am getting back is: 'Breakpoint expression 'error' resulted in an error. The error was Error using==>error Too many output arguments.' Can anyone suggest a way for me to isolate when my variable is becoming negative?