Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Sanchito
Sanchito am 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 :)

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by