From: Bruno Luong on
Actually I just check, it seems nzmax is never set to 0 by Matlab

>> s=sparse([],[],[],1,1,0)
>> nzmax(s)

ans =

1

So I would Realloc Pr and Ir with *1* element, set nzmax to 1, and fill Jc with zeros (as you did).

Bruno