GUI Problem - Reference to non-existent field 'MaxTemperature_Text'.

3 views (last 30 days)
Hey I am trying to program a GUI that tries to fill in two text fields (Static Fields) from the excel file that is opened. So what I mean is that once I open the file, the first Static field is filled with the Max Value and the second static text field is to be filled with Min Temperature. But I am getting the following error
"Reference to non-existent field 'MaxTemperature_staticText'."
The code is as follows:
function Open_File_Callback(hObject, eventdata, handles)
cd('Data Folder')
%uiopen('*.csv')
[FileName,PathName,FilterIndex] = uigetfile ('*.xlsx','Select the Data file');
[num,txt,raw] = xlsread(FileName)
Maximum_temp = max(num);
Maximum_temp = Maximum_temp (1,2)
Minumum_temp = min (num);
Minumum_temp = Minumum_temp (1,2)
Maximum_temp = num2str (Maximum_temp);
Minumum_temp = num2str (Minumum_temp);
set(handles.MaxTemperature_staticText,'String',Maximum_temp);
set(handles.MinTemperature_staticText,'String',Minumum_temp);
cd ../
guidata(hObject, handles);
Any help will be appreciated :)
Thanks
Chito

Accepted Answer

Sanchito
Sanchito on 7 Aug 2011
everyone who comes to this page .. I solved the problem myself :)
Just use
set (handles.MaxTemperature, 'String', Maximum_temp)
and that is the way to define static text :)

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!