Hi Reuben Symons,
I understand that you are using Simulink Test Manager with a .mat file for input signals, and you're experiencing a timing mismatch between the logged signals in the test harness and the input file. Also, the logged signals appear to start at half the intended time and also show inconsistent delays when returning to false.
Assuming that your model and test harness are set up correctly, one possible cause of this issue could be a configuration setting related to the sample time or the synchronization between the test harness and the model. It's also possible that the logging settings might be affecting the timing of the logged signals.
To troubleshoot this issue, you can:
1. Verify that the sample times for the input signals and the test harness are consistent and correctly configured.
2. Check the logging configuration in the test harness to ensure it's set up to log the signals at the appropriate times.
3. If you're using interpolation or resampling methods in the test harness, ensure they match the intended behavior of your input signals.
Here's an example of how you might check and set the sample time in Simulink:
% Load your input .mat file
input_data = load('input_file.mat');
% Check the sample time of the input signal
sample_time = input_data.sample_time; % Replace with actual field name if different
% Set the sample time in your model or test harness
% (Assuming 'your_block_path' is the path to your input block)
set_param('your_block_path', 'SampleTime', num2str(sample_time));
Refer to the documentation of Simulink Test Manager for more information on how to configure and run tests:
To learn about signal logging and how to configure it, refer the documentation on singal logging https://www.mathworks.com/help/slrealtime/signal-logging-start-here.html
Hope this helps!