Borrar filtros
Borrar filtros

Why is the same variable displayed colored and uncolored?

5 visualizaciones (últimos 30 días)
The struct D is displayed with green color until it suddenly (row 562) loses its green color and things go wrong after that.
I have attached an image thats shows the described issue and the entire matlab code
This is a script from a functional magnetic resonance imaging reconstruction tool where I have removed the graphical user interface so that I may run it on a computation cluster that is a linux server
edit: I have also attached the version of the script where the GUI has not yet been removed
  2 comentarios
Star Strider
Star Strider el 21 de Jul. de 2020
It loses its green colour because it is inside the ‘zo_pb_cb’ function. Functions have their own workspaces. Also, varargin does not result in any arguments being aubsequently assigned (at least in the code image). Those are the problems. You need to define the solutions.
I am not posting this as an Answer because it is not one. However it may lead you to a solution.

Iniciar sesión para comentar.

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 21 de Jul. de 2020
There is a warning associated with the blue D. Hover over it to see.
I suspect the issue is that you have accidentally included subfunctions inside the first function. I'm not familiar with your code, but perhaps try inserting the closing "end" for the function defined on line 1 at line 162. This removes any color difference from all instances of D.
I think you will also need to remove the "end" from what is now line 558. There appears to be an extra indent in this function, which may be causing visual confusion.

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by