Reference to a called function result under construction tree

1 visualización (últimos 30 días)
Hi! What on earth does the above mean? (It's an error I'm getting in a nested structure "flattener" I wrote, which works fine on one such structure I've used it with, but broke w/ that error upon trying it w/ another structure. The code's not tremendously long so I can post if need be, but if that error makes sense to someone w/out seeing the code, so much the better. Also, if it helps, both nested structures are output from xml_io_tools/xml_read.m) Thanks in advance.

Respuesta aceptada

Walter Roberson
Walter Roberson el 24 de Jun. de 2011
Sometimes, if you set a breakpoint in a function, and then attempt to view the value of a variable in the parent workspace using the dbup command, the value of the variable is currently under construction. Therefore, the value is not available. This is true whether you view the value by specifying the dbup command in the Command Window or by using the Stack field on the Editor toolbar.
In such cases, MATLAB returns the following message, where x is the variable for which you are trying to examine the value:
K>> x
??? Reference to a called function result under construction x.
For example, suppose you have code such as the following:
x = collatz(x);
MATLAB detects that the evaluation of collatz(x) replaces the input variable, x. To optimize memory use, MATLAB overwrites the memory that x currently occupies to hold a new value for x. When you request the value of x, and it is under construction, its value is not available, and MATLAB displays the error message.
  3 comentarios
Walter Roberson
Walter Roberson el 8 de Ag. de 2016
dbclear is a useful command, but not relevant to this discussion.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Debugging and Analysis en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by