Hi,
I'm not very sure about why you are facing this issue, therefore, could you please provide a detailed explanation along with the model you have buily so that we can investigate further?
Alternatively, instead of using the "To File" block, you can try exploring the utility of "To Workspace" block to log the signals as a timeseries in your base workspace. Further you can use the "save" command to store your variable in a .mat file.