MATLAB: How to find where a variable was set

MATLABvariableworkspace

When using a long script (that is used to call other scripts and functions), is it possible to find where a variable was set. By looking at the variable in the workplace I would like to be able to find the most recent place that it was set.

Best Answer

I believe there is a way you can call dbstop to stop at any line of code where/when a variable changes.