Here's a MATLAB program using the switch-case-otherwise structure to recommend the required action based on the traffic light status/condition:
% Program to suggest action when approaching an intersection
clear all;
clc;
disp('Upon approaching an intersection with working traffic lights...')
inp_status = input('Enter a traffic light status/condition in single quotes: ');
switch inp_status
case 'red'
disp('Stop at the red light and wait for it to turn green.');
case 'green'
disp('Proceed through the intersection if it is safe to do so.');
case 'yellow'
disp('Prepare to stop if it is safe to do so, as the light will soon turn red.');
case 'flashing red'
disp('Stop at the intersection, treat it as a stop sign, and proceed when it is safe.');
case 'flashing yellow'
disp('Proceed with caution, but yield to any vehicles or pedestrians in the intersection.');
otherwise
disp('Invalid traffic light status/condition.');
end