Calculating an HSV histogram
Since you want an histogram, I believe you want to plot it. In GNU Octave you may use hist3 and make three histograms (one for each pair: HxS, HxV and SxV). The code follows bellow:

pkg load statistics
I = imread ('lena.png');
sI = size (I);
Ihsv = rgb2hsv (I);
figure ("position",get(0,"screensize")./[1 1 2 3]);
subplot (1,3,1);
hist3 ( reshape (permute (Ihsv(:,:,[1,2]), [3, 1, 2]), 2, prod(sI(1:2)))' );
title ('H vs S'); xlabel ('H'); ylabel ('S');
subplot (1,3,2);
hist3 ( reshape (permute (Ihsv(:,:,[1,3]), [3, 1, 2]), 2, prod(sI(1:2)))' );
title ('H vs V'); xlabel ('H'); ylabel ('V');
subplot (1,3,3);
hist3 ( reshape (permute (Ihsv(:,:,[2,3]), [3, 1, 2]), 2, prod(sI(1:2)))' );
title ('S vs V'); xlabel ('S'); ylabel ('V');