read and display data from cell array to static box of GUI
1 view (last 30 days)
Show older comments
% --- Executes on button press in Get_Detail.
function Get_Detail_Callback(hObject, eventdata, handles)
% hObject handle to Get_Detail (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
load('stu.mat')
set(handles.text5,'string',['deatail=','stu{1,1}']);
this is the code of my button get_detail. I want that when I push it then cell array named Stu.mat is load and then a particular detail is display on statis box of GUI named text5 from my cell array.
0 Comments
Answers (1)
Geoff Hayes
on 1 Mar 2015
Mohammad - you need to remove the single quotes from around your call to get the first of element of stu else the code will just treat this command as a string. Your set then becomes
set(handles.text5,'string',['deatail=',stu{1,1}]);
2 Comments
Geoff Hayes
on 1 Mar 2015
Mohammad - the code that I modified is based on yours which does not reference a field named text1 but text5.
As for the undefined variable stu, did you load the stu.mat file? Perhaps you need to provide the full path to the file.
If you are going to post an error message like the above, then you need to provide the code that generates the error.
See Also
Categories
Find more on Graphics Performance 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!