Field assignment to a non-structure array object.

4 vues (au cours des 30 derniers jours)
Jun Wang
Jun Wang le 15 Juin 2016
When I run the script shown below, I got this error: Field assignment to a non-structure array object. Does somebody know about this? I appreciate your answer very much.
  1 commentaire
Christoph Haderer
Christoph Haderer le 29 Avr 2017
In my case it helped to simply clear the workspace

Connectez-vous pour commenter.

Réponse acceptée

James Tursa
James Tursa le 15 Juin 2016
Modifié(e) : James Tursa le 15 Juin 2016
When the line "p.MarkerSize = bins" is reached, p is a pre-existing variable that is not a struct. So attempting to treat it as a struct by assigning something to a field named MarkerSize generates an error. You could clear p first before running this script.
  1 commentaire
Steven Lord
Steven Lord le 16 Juin 2016
Or just eliminate that line entirely, since the plot call on the next line will create a plot with markers of the desired size. That would require a slight modification to the plot call, to replace "p.MarkerSize" with "bins".

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots 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