MATLAB: How to nat sort rows of a struct

nat sortstruct

Hi,
I have a matlab script that I am developing for analysing data. After completing some testing last week I have come into the same issue as many others that when I have listed my files that have not been in numerical order. Currently, my files are in this order:
However I need to reorder the rows to have them listed in numerical order with the contents of the rows staying together:
'Emission_1.txt'
'Emission_2.txt'
'Emission_3.txt'
'Emission_4.txt'
'Emission_5.txt'
'Emission_6.txt'
'Emission_7.txt'
'Emission_8.txt'
'Emission_9.txt'
'Emission_10.txt'
'Emission_11.txt'
'Emission_12.txt'
The output struct that I get at the moment looks like
I am really struggling to get them into the correct order while keeping the struct in the same layout. I would really prefer to does as the rest of my script is now built up and I would prefer not to have to change it.
I have looked into using things like natsort, sort_nat and nestedSortStruct but I can't seem to get the output that I need.
Is there a way that this can be done?
I will put my code with attachments too to try and help

Best Answer

FileList = dir(fullfile(Folder, '*.*'));
[~, Index] = natsort({FileList.name});
FileList = FileList(Index);
If the file extensions should not influence the sorting order, use natsortfiles from the same link.