|
On Aug 7, 2:28 pm, "Travis " <sinuso...@hotmail.com> wrote:
> "Matt Fig" <spama...@yahoo.com> wrote in message <h30r33$22...@fred.mathworks.com>...
> > Pass the handles structure to the function.
>
> I have done this and while I can then put a graph in axes using plot(handles.axes1,etc) I cannot set other items; i.e. cannot use set(handles.Sum,'string''for'). How would I go about doing this?
---------------------------------------------------------------------------------
Works for me. Here's an example from my code:
%=====================================================================
% Change the caption on the button depending on how many items
% are selected in the listbox.
function UpdateAnalyzeButtonCaption(hObject, eventdata, handles)
Selected = get(handles.lstImageList, 'value');
if length(Selected) > 1
buttonCaption = {'Step 6: Analyze '}; % MATLAB quirk - needs to be
cell array to keep trailing spaces.
buttonCaption = strcat(buttonCaption, num2str(length(Selected)));
buttonCaption = strcat(buttonCaption, ' images');
set(handles.btnAnalyze, 'string', buttonCaption);
elseif length(Selected) == 1
set(handles.btnAnalyze, 'string', {'Step 6: Analyze 1 image'});
else
set(handles.btnAnalyze, 'string', {'Step 6: Analyze no images'});
end
return;
|