Field assignment to a non-structure array object.

조회 수: 4 (최근 30일)
Jun Wang
Jun Wang 2016년 6월 15일
댓글: Christoph Haderer 2017년 4월 29일
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
Christoph Haderer
Christoph Haderer 2017년 4월 29일
In my case it helped to simply clear the workspace

댓글을 달려면 로그인하십시오.

채택된 답변

James Tursa
James Tursa 2016년 6월 15일
편집: James Tursa 2016년 6월 15일
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
Steven Lord
Steven Lord 2016년 6월 16일
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".

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by