Path: news.mathworks.com!not-for-mail
From: "ching l" <chinglnc@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: field and structure calling
Date: Fri, 18 Jul 2008 18:29:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <g5qndg$p1u$1@fred.mathworks.com>
Reply-To: "ching l" <chinglnc@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216405744 25662 172.30.248.35 (18 Jul 2008 18:29:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 18 Jul 2008 18:29:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:480342



Did I misunderstand the use of field and structure?
Can someone point out my mistakes please.


%% PLAY AUDIO
function select_audio_Callback(hObject, eventdata, handles)

handles.randValue = rand;
wavplay(samples{ceil(length(samples)*handles.randValue)}{:}) ;

guidata(hObject, handles);

%%------------------------------

%% ANSWER

function answer_faster_Callback(hObject, eventdata, handles)

%% write answer in text with the corresponded audio
csvwrite(num2str (get(handles.randValue, 'Value')),[1]); 

guidata(hObject, handles);