The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 9,850
Registered: 6/7/07
Re: Basic Matlab Help
Posted: Dec 5, 2012 6:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 12/5/2012 4:54 PM, Amy wrote:
> dpb <> wrote in message <k9ohvh$bs7$>...
>> On 12/5/2012 4:21 PM, Amy wrote:
>> > ...My goal is to make GUI that displays multiple questions
>> > separately in a random order using randperm. ...

>> Just call randperm() w/ the size of the question list then go down the
>> array of questions in the order of that 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


Not sure what your intent is here...

randperm() only two documented calling syntaxes I'm aware of--one or two
arguments. randperm(N) returns 1:N in random order while randperm(N,K)
returns K<=N from 1:N

What is the maximum number of questions you have?

I have an initialization call that was


then inside the loop that controls them sotoo

for i=1:length(iq)
%display question iq(i)

% break loop logic if any

I'm not a GUI writer so that part you're on your own...


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.