Azzera filtri
Azzera filtri

Why is the same variable displayed colored and uncolored?

5 visualizzazioni (ultimi 30 giorni)
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 Commenti
Star Strider
Star Strider il 21 Lug 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.

Accedi per commentare.

Risposta accettata

Cris LaPierre
Cris LaPierre il 21 Lug 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.

Più risposte (0)

Categorie

Scopri di più su Structures in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by