You don't have to worry about resequencing if you are working with a modern input file. There were SEQGP entries used decades ago that caused resequencing, but if you find any of these in an input file someone give you throw them away. They just make for trouble now. The only automatic resequencing at the node level now occurs for part Superelements. If you aren't using them you don't have to consider possible resequencing.
The problem with correlating node DOF ids with matrix row IDs is that the latter is a closed set, while the node ids are an open set. For example, the first ten rows of the KGG matrix would have the indices 1,2,3....10, while the corresponding node ids could be (100,1),(100,2),(100,3). .
(100,6),(110,1),. . (110,4). This is for a model where the first node id is 100 and the node id's grow by factor of 10. If you are working with matrices that may have rows and columns removed with SPCs each node could have less than six DOF.
The first question to ask is what will you do with the nodeid-ci pairs in Matlab? If it is just to label output it might be easier to bring it back to NASTRAN, which has lots of tools like MATGPR to solve this labeling problem for you. If you are willing to do some work, there are tables named SIL and EQEXIN that correlate the internal sequence and the external sequence used for (nodeid-cid) pairs. They aren't documented very well in the DMAP Programmers Manual, but you may be able to decode them if you table print them in NASTRAN. If you bring these tables to Matlab you could make a paired list of internal and external sequence numbers for your use in Matlab.