The Daily WTF
Follow
CodeSOD: Back to the Lab
Matlab is favored by scientists and researchers but disliked by many programmers. A team using Matlab faced a challenge generating participant-specific images for storage and later reference. Existing constraints made this task difficult within their current setup. A programmer named Jude proposed a workaround to solve this problem. The provided Matlab code aims to process experimental trigger data. It uses a switch statement within a for loop to cycle through different trigger types. The code attempts to reconstruct the intended pattern by counting stimuli and handling various response and non-response scenarios. Comments within the code highlight complex logic and potential data corruption issues. One comment explicitly mentions marking entire trials for deletion due to uncertainty about correct data. It was discovered that a significant portion of the provided logs represented different, unknown experiments.