Update: here's a better idea of what i'm trying to do but I can't seem to figure out how to iterate through a loop and modify a corresponding pushbutton: i=1, pushbutton1; i=2,pushbutton2 etc..heres what i tried but it doesn't like my pushbutton tag reference
function parkinglot_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to parkinglot (see VARARGIN)
A = [0 0 0 1 1];
for i = 1:5
if A(i) == 1
set(handles.(pushbutton + i), 'backgroundcolor', 'green');
else
set(handles.(pushbutton + i), 'backgroundcolor', 'red');
end
end