Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

How to make a text figure close after an input command, how do I also make a text figure show up after an input command

2 visualizzazioni (ultimi 30 giorni)
Im making a new script and I don't have experience at all. Im trying to make a figure close after an input command. Here is my code:
x = {'Choose the number you would like to solve'; '1 = Kinetic Energy';'2 = Potential Energy';'3 = Net Force';'4 = Velocity/Time/Distance';'5 = ';'6 = ';'7 = ';'8 = ';'9 = ';'10 = '};
y = strcat(char(183), x);
figure
uicontrol('style','text','position',[0,210,500,200],'string',y,'fontsize',12)
choice = input ('Press the number you like to solve for ')
I don't know what to type next after this to make the figure close

Risposte (1)

Ameer Hamza
Ameer Hamza il 26 Set 2020
You can use close()
x = {'Choose the number you would like to solve'; '1 = Kinetic Energy';'2 = Potential Energy';'3 = Net Force';'4 = Velocity/Time/Distance';'5 = ';'6 = ';'7 = ';'8 = ';'9 = ';'10 = '};
y = strcat(char(183), x);
f = figure
uicontrol('style','text','position',[0,210,500,200],'string',y,'fontsize',12)
choice = input ('Press the number you like to solve for ')
close(f);

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by