フィルターのクリア

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

1 回表示 (過去 30 日間)
Sanchito
Sanchito 2011 年 8 月 7 日
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 Center および File ExchangeString Parsing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by