Since your question mentions a Do
loop over your matrix, (not a Table or Map), I'll first assume you're not building a new matrix, you don't care at all about your single-element data, but you actually really care about the positions of the 3-element-stuff within your structure as well as the 3-element-stuff.
If you don't care about the positions and you're just looking to make a new matrix with your 3-element stuff modified, then as Alan says you can just Map your function at level {2}
over your data with a conditional.
First I'll make some stuff;
stuff = Table[
If[RandomReal[{0, 1}] < .01, {a[i, j], b[i, j], c[i, j]}, d], {i,
1, 100}, {j, 1, 100}];
If you really care about the positions in your matrix, i.e. you want to do something to the 3-element stuff, and you need to know where it came from, but you don't need to make a new matrix:
locationsOfLength3 =
Select[Position[stuff, x_ /; Length[x] === 3], Length[#] === 2 &];
Do[ somethingWithStuff[ stuff[[p[[1]], p[[2]]]] , p ],
{p,locationsOfLength3}]
Note: I'm passing the location to my function as well as what was in stuff at that location. If you don't need the location, and don't need a matrix, you can ignore that bit.
If you need a matrix, but your function somethingWithStuff
also needs to know where in your matrix the 3-element-stuff came from, you can do it with MapIndexed:
newMatrix=MapIndexed[ If[Length[#] === 1, #,
somethingWithStuff[#, #2]] &, stuff, {2}];
If
expression test onLength
orDimension
. $\endgroup$