button to plot waveforms

1 view (last 30 days)
Bianca Iusco
Bianca Iusco on 9 Jan 2019
Answered: Akira Agata on 10 Jan 2019
I have to define a GUI and have a button that plots waveforms

Answers (1)

Akira Agata
Akira Agata on 10 Jan 2019
Like this?
function guiSample()
h = figure;
uicontrol(...
'Parent', h,...
'Units', 'normalized',...
'Position', [0.1 0.8 0.4 0.1],...
'String', 'Push!',...
'Callback', @Callback_pb);
ax = axes(...
'Parent', h,...
'Units', 'normalized',...
'Position', [0.1 0.1 0.8 0.6]);
function Callback_pb(~,~)
plot(ax,magic(4))
end
end
guisample.png

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!