movefile(source, dest) moves the file from source to dest. The error message means, that the source file is not found.
You did not show or explain it, but it seems like the structs filesA and filesB come from the dir() command. Then note, that the fields name contain the file name only, but not the absolute path with the folder name. Then the file "filesB(i).name" are searched in the currently active folder as replied by cd.
When the filesA are insider C:\Temp\FolderA and for filesB in C\Temp\FolderB, add these names to get absolute files:
pathA = 'C:\Temp\FolderA'
pathB = 'C:\Temp\FolderB'
filesA = dir(fullfile(pathA, '*.ext'));
filesB = dir(fullfile(pathB, '*.ext'));
...
movefile(fullfile(pathB, filenameB), fullfile(pathA, filenameA))
Btw, I did not understand which file should be renamed by which strategy.
Best Answer