How to Do Histogram Equalization in Imagesc's 3 Parameters of Matlab? : Situation: do histogram of the presentation in `imagesc(time,potential,C)` by using `time`, `potetial` and/or `C`; do normalized histogram equalization in the histogram       
Proposal: I think `C` is the data for the histogram because `time` and `potential` are just equispaced-equidistant vectors for x- and y-axis, respectively         
Code and pseudocode

    time=linspace(0,50,100 + 1); 
    potential=linspace(0,50,100 + 1);
    C=gallery('wilk',21); % tridiagonal matrix, eigenvalue problem, Wilkinson 1965
    figure, imagesc(time,potential,C); 
    
    %% Output: Tridiagonal image
    
    %% Histogram Equalization Pseudocode 
    % Draw here the histogram of time, potential and/or C
    C=histogram_equalization(C,...);
    figure, imagesc(time,potential,C);

    %% Expected output: tridiagonal image after histogram equalization

Observations


- `C` is not an intensity image because `figure, imhist(C)` returns blank output
- I may need to consider `time` and `potential` also when considering the histogram of `C`. However, they are just equally spaced vectors for the axes so it should not be necessary. 

Unsuccessful attempts

- RockTheIT's [code][3] is based on the image handler (`hFig`) or reading .png images. You cannot just put `I=C`, although `I` is a matrix. Why?

- `hist` attempt based on the thread [Difference between hist and imhist][4] gives blank image in `imagesc(x,y,C)` where I am trying to plot all contents of `C` for histogram

        C = hist(double(C(:)), 256);
        

Signal Processing
 
- Gonzales says the *normalized histogram is given* by $p(r_k) = r_k / M N$, for $k = 0,1,2,...,L-1$ where 
    - intensity levels ranges in $[0,L-1]$, 
    - $p(r_k)$ is an estimate of the probability of occurrence of intensity $r_k$ in an image, 
    - $MN$ is the product of the pixel sizes in `time` and `potential`, respectively

Sources

1. Gonzales, *Digital Image Processing* 3rd ed. Ch. 3 about the Mathematics of histograms. 


System: Linux Ubuntu 16.04 64 bit   
Matlab: 2016a        
Hardware: Macbook Air 2013-mid    
 


  [1]: http://i.stack.imgur.com/3iURCs.jpg
  [2]: http://i.stack.imgur.com/3iURC.jpg
  [3]: http://www.rocktheit.com/2012/09/matlab-program-to-apply-histogram.html
  [4]: https://se.mathworks.com/matlabcentral/answers/146986-difference-between-hist-and-imhist