Write a function that will create a simple GUI with one static text box near the middle of the Figure Window. Put your name in the string, and make the background color of the text box white
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:13| Question number:13.13
All Answers
total answers (1)
Ch13Ex13.m
function Ch13Ex13
% Simple GUI with a static text box
% Format of call: Ch13Ex13
% Does not return any values
% Create the GUI but make it invisible for now while
% it is being initialized
f = figure('Visible', 'off','color','white','Position',...
[300, 400, 500, 325]);
htext = uicontrol('Style','text','Position', ...
[200, 150, 100, 25], 'String','Hello, Kevin!',...
'BackgroundColor','white');
% Put a name on it and move to the center of the screen
set(f,'Name','Simple GUI')
movegui(f,'center')
% Now the GUI is made visible
set(f,'Visible','on');
end
need an explanation for this answer? contact us directly to get an explanation for this answer