Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Re: matlab random object



Tip: Looking for answers? Try searching our database.



You are accessing this site in a read-only mode. For full access to all member benefits, including message posting, please login or register. Registration is completely free, simple, and takes only a few seconds.

Login | Free MathKB.com registration | Whole discussion thread

The message you are replying to and its parents are listed in the reverse order with the most recent posts first. This might not be the whole discussion thread. To read all the messages in this thread please click here.

Re: matlab random object

Walter Roberson11 Jul 2008 17:13
>I'm so sorry, but that's not very clear...

>I'm quite new in matlab, basically, I need to make sure the
>file can be played randomly when i click the Play button in
>the gui........

>possible to do that?

[data, speed] = wavread(file1);
samples{1} = {data, speed};
[data, speed] = wavread(file2);
samples{2} = {data, speed};
[data, speed] = wavread(file3);
samples{3} = {data, speed};

uicontrol('Style','pushbutton','String','Play Randomly', ...
 'Units', 'normal', 'Position', [1/2 1/2 1/4 1/4], ...
 'Callback', @(src, evt) wavplay(samples{ceil(length(samples)*rand)}{:}) );

Signature

 "Beauty, like all other qualities presented to human experience,
 is relative; and the definition of it becomes unmeaning and
 useless in proportion to its abstractness." -- Walter Pater


ching l11 Jul 2008 17:05
I'm so sorry, but that's not very clear...

I'm quite new in matlab, basically, I need to make sure the
file can be played randomly when i click the Play button in
the gui........

possible to do that?

us11 Jul 2008 15:40
"ching l":
<SNIP wants to randomize the rest of the world...

one of the solutions

% the data
    lst={
         'unique.m'
         'whos.m'
         'figure.m'
    };
% the engine
% - randomly select a file for editing...
    ix=ceil(size(lst,1)*rand);
    edit(lst{ix});

us

ching l11 Jul 2008 14:32
does rand in matlab only applicable for numbers?

What can I do if I want to randomise the files?

for examples:

wavread (file1);
wavread (file2);
wavread (file3);

wavplay rand(file); - the wavplay randomly choose from the
                      wavread

is it possible to do that?

Thanks in advance.

Quick links:

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage




©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.