의 MATLAB 2017a에서 실행할 수 없습니다 matlab에 예제 코드 (리눅스 64bit를) 이 https://cn.mathworks.com/help/matlab/ref/bar.htmlmatlab에 :하려면 CData이 존재 없음 공공 재산을 바 없다
b = bar(rand(10,1));
b.FaceColor = 'flat';
b.CData(2,:) = [.5 0 .5];
그것은 특정 줄을 색상과 같은 경고를 할 수 없습니다
matlab.graphics.chart.primitive.Bar 클래스에 대한 공용 속성 CData가 없습니다.
Matlab 2017b의 특정 기능 만 알지 못합니다.
이 코드는 특정 바를 색칠하기위한 것입니다. Matlab 2012a에서는 다음과 같이 쉽게 할 수 있습니다 :
bh=bar(MyStem); h=get(bh, 'children');
shading flat; set(h,'FaceVertexCData',MyColor);
Matlab 2017이이 기능을 제거한 이유를 이해할 수 없습니다.
는'CData'는 2017b의 새로운 속성입니다. 한 막대 만 색을 변경하려면 다음과 같은 좋은 아이디어가 있습니다. https://stackoverflow.com/questions/45568120/matlab-bars-changing-the-color-of-the-bar-and-the -space-between-bars-axes – Adiel
빠른 답을 보내 주셔서 감사 드리며 Matlab 2017b 이전에는 CData도없고'get (barHandle, 'children')'도 없으므로 당황 스럽습니다. – Nico