Hi Chai Chee,
I understand that you are facing an error while executing 'iconshift.m' file.
As the error suggests,
unrecognized function or variable 'X'
Please use debugger available in MATLAB Editor toolstrip. Place breakpoints in the statements to analyse if the variable is created when the execution is at that point. Please find the screenshot of debugger with breakpoint below:
Hope this helps!