The question does not permit us to assume that the struct fields are exclusively numeric or that the fields will not be compound data types, or that the initial structure is a scalar structure. We must assume that it might be a non-scalar structure, containing nested data types, and that for any given field at the top level, if there is a nan anywhere inside the object in any of the array dimensions, that the field must be removed from all struct array locations.
Taking this into consideration, you need a real function, and it is probably easiest to make the function recursive.
Under some restricted conditions, this code could be simplified.
function S = structrmnan(S)
Sfields = fieldnames(S);
tc = struct2cell(S);
cn = cellfun(@containsNan, tc);
mask = any(cn, 2:ndims(cn));
tc(any(cn, 2:ndims(cn)),:) = ;
S = reshape(cell2struct(tc, Sfields(~mask), 1), size(S));
function tf = containsNan(V)
tf = nnz(isnan(V))>0;
elseif ischar(V) || islogical(V)
tf = false;
tf = any(arrayfun(@containsNan, V(:)));
tf = any(cellfun(@containsNan, V(:)));
tf = any(structfun(@containsNan, V(:)));
error('Needs to be extended to handle datatype "%s"', class(V))