I'm using GUIDE, and I've imported data like this:
function control_browse_button_Callback(hObject, eventdata, handles)% hObject handle to control_browse_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of control_browse_button
[control_file control_pathname] = uigetfile({'*.xlsx'}, 'File Selector');set(handles.control_filename,'String', control_file);[control_data control_labels] = xlsread(control_file);handles.control_data = control_data;handles.control_labels = control_labels;
And then I attempted to access control_labels:
function loadfile_button_Callback(hObject, eventdata, handles)% hObject handle to loadfile_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of loadfile_button
for i = 3:size(handles.control_labels,1)ctrl_labels{i-2} = handles.control_labels{i,1};end....%(rest of the code for this callback)
...
But I'm getting the error:
Reference to non-existent field 'control_labels'
Am I not using handles properly? How should I access control_labels from another callback function?
Thanks!
Best Answer