How to save all trials in Matlab

Hello,
The goal is to make a code in which all responses are being saved.
This is the code so far, but it only saves the last response. Anyone know how to save all responses?
for k = 1 : ntrials; fixationcross(w,fixvhdim,linewidth,screenrect); Screen('Flip', w); WaitSec(ISI); filenumber = randomOrder1(k); fullFileName = fullfile(pwd, baseFileNames1{filenumber}); img = imread(fullFileName); Screen('PutImage', w, img); Screen('Flip', w); WaitSecs(0.002);
filenumber = randomOrder2(k);
fullFileName = fullfile(pwd, baseFileNames2{filenumber});
img = imread(fullFileName);
Screen('PutImage', w, img);
Screen('Flip', w);
getaresponse;
counterclockresponse(ntrials) = getaresponse;
end

 採用された回答

Mischa Kim
Mischa Kim 2014 年 6 月 12 日

0 投票

M, use instead
counterclockresponse(k) = getaresponse;

1 件のコメント

M
M 2014 年 6 月 12 日
Thanks a lot, this works!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

タグ

質問済み:

M
M
2014 年 6 月 12 日

コメント済み:

M
M
2014 年 6 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by