Path: news.mathworks.com!newsfeed-00.mathworks.com!panix!bloom-beacon.mit.edu!llnews!53ab2750!not-for-mail
From: Peter Boettcher <boettcher@ll.mit.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: no repeat for rand
References: <g69avu$ai0$1@fred.mathworks.com>
Message-ID: <muyzlo740q9.fsf@G99-Boettcher.llan.ll.mit.edu>
Organization: MIT Lincoln Laboratory
User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux)
Cancel-Lock: sha1:S2q6zlGZntzdbosbOuvbWmUZeRE=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 42
Date: Thu, 24 Jul 2008 14:05:02 -0400
NNTP-Posting-Host: 155.34.163.114
X-Complaints-To: news@ll.mit.edu
X-Trace: llnews 1216921957 155.34.163.114 (Thu, 24 Jul 2008 13:52:37 EDT)
NNTP-Posting-Date: Thu, 24 Jul 2008 13:52:37 EDT
Xref: news.mathworks.com comp.soft-sys.matlab:481616



"ching l" <chinglnc@hotmail.com> writes:

> "David " <dave@bigcompany.com> wrote in message
> <g6a0v2$rtq$1@fred.mathworks.com>...
>> "ching l" <chinglnc@hotmail.com> wrote in message 
>> <g69uif$nne$1@fred.mathworks.com>...

>> > [audio, fs] = wavread('G:\wyei.wav');
>> > a{5} = {audio, fs};
>> >  
>> > fixrand= ceil(length(samples)*rand);
>> > fixrand= randperm(5); 
>> > 
>> > wavplay(a{fixrand)}{:});
>> > 
>> 
>> thats one step better... but you still have 2 assignments 
>> to fixrand without using the first one, and the () and {} 
>> in the wavplay don't match up.
>
> sorry, I definitely not a bright person, I need a bit
> explanation of this please
>
> 1.you still have 2 assignments to fixrand without using the
> first one

If I say:

a = 5;
a = 4;

What value does "a" have right now?  What use is the first line?

I highly recommend finding a class for beginner programming.  Through
your company, through your university, somewhere.  Many of the questions
you have are not really MATLAB questions, they are more related to the
basics of thinking about programming.  I mean no offence, I think this
would be worth your time and money if you plan on continuing to work in
MATLAB.


-Peter