MATLAB: How to add new images into the MATLAB build-in images

imageimage processing

Basicly, I want to add new images from the internet to the MATLAB built-in images and I want to use like
imshow('cameraman.tif')
wherever and whenever I want. I found the folder that includes images and it's -> 'C:\Program Files\MATLAB\R2016a\toolbox\images\imdata' I copied to there a new image and i tried call the new image on command window with
imshow('new_image.tif')
But it didn't work. Is there any way to do it?

Best Answer

You shouldn't add, delete, or modify files in a directory under the MATLAB root directory. Put your data files in a different directory and add it to the MATLAB search path.
You can use the pathtool function to add a directory to the search path. Searching the documentation for the phrase "search path" should show more information about the path.