Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Basic Matlab Help
Replies: 4   Last Post: Dec 5, 2012 6:11 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Casey

Posts: 4
Registered: 9/8/12
Re: Basic Matlab Help
Posted: Dec 5, 2012 5:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <none@non.net> wrote in message <k9ohvh$bs7$1@speranza.aioe.org>...
> On 12/5/2012 4:21 PM, Amy wrote:
> > Let me start by saying this is probably going to be super basic for most
> > of you. My goal is to make GUI that displays multiple questions
> > separately in a random order using randperm. I've got my initial
> > question popping up just fine, but I'm not sure how to use randperm for
> > automatically moving on to the next random question, at all....

>
> Just call randperm() w/ the size of the question list then go down the
> array of questions in the order of that returned...to repeat then do it
> over again.
>
> --


Actually, sorry, that's wrong. THIS is my code:

function final()
f = figure

a = (1:2);
d = randperm(1,1,2) + 1;
for i = 1:2
while a(1,d) ~= d
d = randperm(1,1,2) + 1;
end





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

uicontrol('style','popupmenu','string','Choose|Blue|Red|White')
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end



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

uicontrol('style','popupmenu','string','Choose|Blue|Red|White')
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.