Search code examples
imagematlabimage-processingmatlab-figurevideo-processing

MATLAB image processing installed, but imhist doesn't work


I was trying to get a histogram for an image (uint8, Using MATLAB R2016a), but am getting the following message:

Undefined function or variable 'imhist'.

I have double checked, and my image processing toolbox is installed (as seen in the attached screenshot). I have looked around for quite a while, but still couldn't spot the problem.


Solution

  • Check the MATLAB path to make sure the toolbox is listed there.

    1. Through the GUI

      Access Set Path through the GUI's top menubar, see screenshot:

      Set path

      A dialog with a list of the different toolboxes that are on your path will popup next. You can add the toolbox directly if it is not already there.

    2. Through the command window.

      To see your current list of paths that are accessible, type:

      path
      

      If you know the pathname where the toolbox is, then you can add it directly like this:

      toolboxPath = '/your/paths/toolbox/image';
      addpath(genpath(toolboxPath));