GUIDE newbie questions
Using GUIDE, I cannot figure out how to enter a file name acquired through uigetfile into a table cell. Any halp for this simple funciton greatly appreciated.
No products are associated with this question.
filename = uigetfile('*.jpg'); %for example
curdata = get(handles.uitable1, 'Data'); %example handle name
curdata{3,2} = filename; %3,2 is example location
set(handles.uitable1, 'Data', curdata); %same example handle name
Hi Walter
Thanks for your help earlier.. The comment field would not open before, but it has now, so here here goes.
Your example worked well, but I need to be able to select a cell using the mouse into which to put the file name rather than pre-assigning a cell position.
I've tried the following in uitable1_CellEditCallback:
handles.fpointer = get(handles.uitable1,'Indices')
guidata(hObject, handles);
to get the cell indices, but Matlab reports:
Error using hg.uitable/get The name 'Indices' is not an accessible property for an instance of class 'uitable'.
Error in test>uitable1_CellSelectionCallback (line 96) handles.fpointer = get(handles.uitable1,'Indices')
Not quite sure where to go next
D.
Indices is a field of the eventdata that gets passed to the callback.
How about
dataTable = {'FileName'; filename};
set(handles.uitable1, 'data', dataTable);
Hi Image Analyst
Thanks for the answer. It got me thinking 'handles' better, but ended up converting the table to a single entry. Go figure.
Anyway, I'm starting to see that the black abyss called MatLab GUI Programming is actually clear water for those willing to spend the time - but they remain somewhat murky still for me at the moment, but clearing.
cheers
D.
1 Comment
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/45943#comment_94372
what do you mean enter a file name acquired through uigetfile into a table cell