You can use strtrim()in combination with structfun()and indexing cells:
your_struct = structfun(@(x) strtrim(x{1}), your_struct);
This only works if your structure has a layout, for example
your_struct.a = {' some string '};
your_struct.b = {' some other string '};
...
If it has a different structure, let's say
your_struct.a = { {' some string '}
{' some other string '}};
your_struct.b = { {' again, some string '}
{' again, some other string '}};
...
You can try
your_struct = structfun(@(x) ...
cellfun(@strtrim, x, 'uni', false), ...
your_struct, 'uni', false);