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

1 次查看(过去 30 天)
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

采纳的回答

Sanchito
Sanchito 2011-8-7
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 :)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by