MATLAB: How to troubleshoot “Undefined function or variable ‘xticks’.” on MATLAB R2016a.

bugerrorsMATLABnot a bugr2016axticks

Getting "Undefined function or variable 'xticks'." on MATLAB R2016a on my home laptop. Script works perfectly fine on my work computer. Please advise.

Best Answer

According to xticks, then function was introduced in MATLAB R2016b. Your work computer must be at least on version R2016b. On your version, you may need to do something like
get(hAxes, 'XTick')
to get the current x-ticks for your axes given the handle hAxes, and
set(hAxes, 'XTick', ...)