Results 1 to 2 of 2

Math Help - Matlab HELP

  1. #1
    Newbie
    Joined
    Mar 2010
    Posts
    3

    Matlab HELP

    I am using textread to read a list of audio files to be played.
    when i do it, it returns a cell array looking like this

    wavfile =

    'BDAT1.wav'
    'BDAT3.wav'
    'BDOUGH1.wav'
    'BPAY5.wav'
    'BDAY4.wav'

    when i try to read it... it gives me an error

    >> audio = wavfile(2)

    audio =

    'BDAT3.wav'

    >> [audio1, fs, nbits] = wavread(audio);
    ??? Error using ==> fileparts at 17
    Input must be a row vector of characters.

    Error in ==> wavread>open_wav at 192
    [pat,nam,ext] = fileparts(file);

    Error in ==> wavread at 64
    [fid,msg] = open_wav(file);

    what am I doing wrong... i have spent hours -
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Mar 2010
    Posts
    3
    Well I figured that problem out, I just used convert2vector on that cell and it did it.

    But now I have another issue....

    try
    screens=Screen('Screens');
    screenNumber=max(screens);

    HideCursor;
    gray=GrayIndex(screenNumber);
    [w, wRect]=Screen('OpenWindow',screenNumber, gray);
    Screen('TextSize', w, 72);
    Screen('TextFont', w, char('Arial'));

    % Do dummy calls
    KbCheck;
    WaitSecs(0.1);
    GetSecs;

    priorityLevel=MaxPriority(w);
    Priority(priorityLevel);

    Fs = 44100;

    message = 'test1';
    DrawFormattedText(w, message, 'center', 'center', WhiteIndex(w));
    Screen('Flip', w);
    KbWait([], 2);
    Screen('Flip', w); %clear to grey

    for x = 1:5
    [keyIsDown, secs, keyCode, deltaSecs] = KbCheck;
    if keyCode(stopkey)
    Screen('CloseAll');
    disp('stop key pressed');
    end
    audio = strcat('stim\',wavfile(x));
    newwave = convert2vector(audio);
    ..."

    after the message - test1 appears on screen it just goes to a blank gray screen and doesn't start the for loop work. Anyone know why?

    Thank you
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: February 11th 2010, 03:59 AM
  2. Matlab FFT Help
    Posted in the Math Software Forum
    Replies: 0
    Last Post: June 3rd 2009, 01:48 PM
  3. help about ODE in matlab
    Posted in the Math Software Forum
    Replies: 1
    Last Post: May 31st 2009, 04:10 AM
  4. Matlab
    Posted in the Math Software Forum
    Replies: 0
    Last Post: November 6th 2008, 09:46 AM
  5. Matlab
    Posted in the Calculus Forum
    Replies: 3
    Last Post: August 20th 2008, 11:39 PM

Search Tags


/mathhelpforum @mathhelpforum