MATLAB: Help with Tick mark labels

labelsmarkertick

Please help me with changing tick mark labels
struktura.jmeno = 'data';
struktura.data = [0.0231 0.0197 0.0260;
0.0653 0.0300 0.0330;
0.3030 0.2320 0.2700;
0.2120 0.1370 0.1650];
struktura.popis = {'Šroub','Faston','Konektor1','Konektor2'};
struktura;
bar3(struktura.data, 'grouped')
h = gca;
h.XTickLabel = struktura.popis;
And error is:
Warning: Struct field assignment overwrites a value with class "double". See MATLAB
R14SP2 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning,
for details.
Thaks a lot in advance

Best Answer

The syntax you're using there will only work in the latest release of Matlab (R2014b). In earlier versions, the graphics handle ( h) will be a double, and the warning is letting you know that you changed that double to a structure when you added a field (and doing so will not add tick labels to said axis).
To change the xticks, use
set(h, 'xticklabel', struktura.popis);