newfilename is a variable in your workspace when you define it as
newfilename = fullfile(newsubfolder, filenamei);
In your first argument to save(), you say "newfilename.mat", which attempts to access the mat field of object newfilename. Hence the error Attempt to reference field of non-structure array.
Try this syntax instead:
Or if you really want to tag ".mat" on the end explicitly: