Matlab Help - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Matlab Help

andiemacandiemac Posts: 2Member
Stuck on a basic intro to matlab class assignment. If you have any tips, great! Just need a nudge in the right direction. Thanks!

I need to present three questions in a GUI, and I need these to present in a random order. I've included one of my questions (which works fine) but having trouble figuring out how to make them appear randomly (not even sure how to get the next question, which should be displayed separately, to popup automatically after the first question is answered). Hopefully this makes sense! And thanks to anyone who can offer some advice.

function Final ()

a = (1:3);

d = randint(1,1,3) + 1;

for i = 1:52

while a(1,d) ~= d

d = randint(1,1,3) + 1;


function FavoriteDog()

f = figure

handles.questionOne = uicontrol('style','text','position',[400 200 150 60], ... 'string', 'What is your favorite dog?', 'fontsize', 16);

uicontrol('style','popupmenu','string','Choose|Poodle|Pug|Lab') if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
Sign In or Register to comment.