Simple Button
古いコメントを表示
I'm trying to make simple button that will update image of a matrix with each press. Image should cycle through colors from blue to red. See code modified from GUI example below (how to update S.v?):
function [] = GUI_10()
S.fh = figure('units','pixels',...
'position',[200 200 500 500],...
'menubar','none',...
'numbertitle','off',...
'name','GUI_10',...
'resize','off');
S.ax = axes('units','pixels',...
'position',[75 150 350 350]);
S.v=ones(3,3);
S.im = image(S.v);
S.pb = uicontrol('style','push',...
'units','pixels',...
'position',[10 10 180 30],...
'fontsize',14,...
'string','Next',...
'callback',{@pb_call,S});
function [] = pb_call(varargin)
S = varargin{3};
S.v=S.v+1;
S.im=image(S.v);
回答 (1 件)
Walter Roberson
2011 年 7 月 25 日
0 投票
カテゴリ
ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!