MATLAB: How to flip the direction of the axis

axislabel;ticksx axis

Dear all,
I want to change the x-axis direction from right to left but also keeping the values to be not affected (reversed/flipped). when I used the fooling command the mentioned problem is caused:
set(gca, 'XDir','reverse')
How can I solve that?
thanks

Best Answer

xticklabels([1:10]) %an example
set ( gca, 'xdir', 'reverse' )