Effacer les filtres
Effacer les filtres

Why is the same variable displayed colored and uncolored?

5 vues (au cours des 30 derniers jours)
Pseudoscientist
Pseudoscientist le 21 Juil 2020
Commenté : Pseudoscientist le 21 Juil 2020
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 commentaires
Star Strider
Star Strider le 21 Juil 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.
Pseudoscientist
Pseudoscientist le 21 Juil 2020
thanks

Connectez-vous pour commenter.

Réponse acceptée

Cris LaPierre
Cris LaPierre le 21 Juil 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.

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by