Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 Casey Posts: 4 Registered: 9/8/12
Re: Basic Matlab Help
Posted: Dec 5, 2012 5:46 PM

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.
>
> --

This is kind of what I was thinking...not sure if it's at all correct. I am a total newbie to Matlab/programming in general.

function final()

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

f = figure

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

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

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

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

Date Subject Author
12/5/12 Casey
12/5/12 dpb
12/5/12 Casey
12/5/12 Casey
12/5/12 dpb