Really there is zero code in your post so no one knows what you are actually doing.
Also no one knows whether it is AFL or C code. It might be latter one since it is plugins section but no one knows for certain.
Actually it does not matter. All that matter is: PriceVolDistribution is type matrix and it always has n-rows for all of its two columns. And there is always even number of elements.
Cells do not contain nothing. You simply misinterpret your output.
Your output is rather like this
Now two columns with twenty rows follow (since you have set 20 bins).
First column is price and second column is volume (relative or absolute depending on setting).
i1 are some garbage output not related to distribution matrix (or result of incorrect code).
You need to check your code. It is your code. No one knows your code.
Since you have not posted code here is AB user guide code just adding print output.
/// a demo showing
/// re-implementation of VAP overlay using
/// PriceVolDistribution and low-level graphics
/// @link https://www.amibroker.com/guide/afl/pricevoldistribution.html
bi = BarIndex();
fvb = FirstVisibleValue( bi );
lvb = LastVisibleValue( bi );
param_bins = Param( "Bins", 20, 10, 100, 1 );
mx = PriceVolDistribution( H, L, V, param_bins, False, fvb, lvb );
printf( "%s\n\n", MxToString(mx));
GfxSetCoordsMode( 1 );
GfxSelectPen( colorRed );
bins = MxGetSize( mx, 0 );
printf( "ALWAYS even number of matrix elements: %g\n\n",
for( i = 0; i < bins; i++ )
price = mx[ i ][ 0 ]; // price level
relvolume = mx[ i ][ 1 ]; // relative volume 0..1
relbar = relvolume * ( lvb - fvb + 1 );
printf( "row idx: %g, %g, %g\n", i, price, relvolume);
GfxMoveTo( fvb, price );
GfxLineTo( fvb + relbar, price );
Plot( C, "Price", colorDefault, styleBar );
Setting n-bins results in n-rows for all columns.
Bottom line PriceVolDistribution function works fine and correctly.