Memorandums

知覚・認知心理学の研究と教育をめぐる凡庸な日々の覚書

Block ごとにファイル名を変えてデータを保存

2011-11-20 | PsychToolBox

 

Block ごとにファイル名を変えてデータ(Data)を保存する。ファイル名の最後にblock番号を追加した。

 

subnum=input('Please enter your No.','s');% input Subject Number

 

blk=1;

blkn=5; % Number of blocks

while blk<blkn+1 %  ============= block

 

%re-order the 16 trials randomly

tr=1;

trn=16; % Number of trials

 

while tr<trn+1 % Start the trial -------------------------

 

% Stimuli Presentation

% Response 

tr=tr+1;

end;% End of one trial -----------------------

 

savefile=['Exp2011_',subnum,'_' num2str(blk)];

save (savefile,'Data'); 

blk=blk+1;

end; % End of one block =====================

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Rand()

2011-11-14 | MATLAB

>> help Rand
 RAND Uniformly distributed pseudorandom numbers.
    R = RAND(N) returns an N-by-N matrix containing pseudorandom values drawn
    from the standard uniform distribution on the open interval(0,1).  RAND(M,N)
    or RAND([M,N]) returns an M-by-N matrix.  RAND(M,N,P,...) or
    RAND([M,N,P,...]) returns an M-by-N-by-P-by-... array.  RAND returns a
    scalar.  RAND(SIZE(A)) returns an array the same size as A.
 
    Note: The size inputs M, N, P, ... should be nonnegative integers.
    Negative integers are treated as 0.
 
    R = RAND(..., 'double') or R = RAND(..., 'single') returns an array of
    uniform values of the specified class.
 
    Compatibility Note: In versions of MATLAB prior to 7.7, you controlled
    the internal state of the random number stream used by RAND by calling
    RAND directly with the 'seed', 'state', or 'twister' keywords.  That
    syntax is still supported for backwards compatibility, but is deprecated.
    Beginning in MATLAB 7.7, use the default stream as described in
    RANDSTREAM. *これは知らなかった。
 
    The sequence of numbers produced by RAND is determined by the internal
    state of the uniform pseudorandom number generator that underlies RAND,
    RANDI, and RANDN.  Control that default random number stream using its
    properties and methods.  See RANDSTREAM for details about the default
    stream.
 
    Resetting the default stream to the same fixed state allows computations
    to be repeated.  Setting the stream to different states leads to unique
    computations, however, it does not improve any statistical properties.
    Since MATLAB uses the same state each time it starts up, RAND, RANDN, and
    RANDI will generate the same sequence of numbers in each session unless
    the state is changed.
 
    Examples:
 
       Generate values from the uniform distribution on the interval [a, b].
          r = a + (b-a).*rand(100,1);
 
       Generate integer values from the uniform distribution on the set 1:n.
          r = randi(100,1);
 
       Save the current state of the default stream, generate 5 values,
       restore the state, and repeat the sequence.
          defaultStream = RandStream.getDefaultStream;
          savedState = defaultStream.State;
          u1 = rand(1,5)
          defaultStream.State = savedState;
          u2 = rand(1,5) % contains exactly the same values as u1
 
       Replace the default stream with a stream whose seed is based on CLOCK, so
       RAND will return different values in different MATLAB sessions.  NOTE: It
       is usually not desirable to do this more than once per MATLAB session.
          RandStream.setDefaultStream(RandStream('mt19937ar','seed',sum(100*clock)));
          rand(1,5)
 *これを使う。
    See also Randi, randn, RandStream, RandStream/rand, RandStream/getDefaultStream,
             sprand, sprandn, randperm.
    Overloaded methods:
       RandStream/rand
    Reference page in Help browser
       doc rand
>>

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Jigsaw Puzzle & Alzheimer's disease

2011-11-11 | Research

Healthy Brain

Alzheimer Society of Canada

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Mathematica入門

2011-11-06 | Education

神戸大学 Mathematica ホームページ

http://bach.istc.kobe-u.ac.jp/mma/

 

Mathematica ホームエディション

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

QuickTime Player で画面を録画する

2011-11-05 | Computer & Network

QuickTime Player の画面収録機能を使う。心理実験で、画面上の操作の行動記録に使うこともできる。

 

Mac 101:QuickTime Player

http://support.apple.com/kb/HT4024?viewlocale=ja_JP

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

画像の一部を提示する 2

2011-11-04 | PsychToolBox

読み込んだ画像の一部を選択し、画面上の位置を指定して提示する。

DrawTextureのパラメータで指定する。

1) 対角線上の2点で矩形領域を選択する。

2) 提示位置を指定する。同様に矩形領域で指定。指定した領域の大きさによって、拡大/縮小される。

%準備

screens=Screen('Screens');

screenNumber=max(screens);

[window,screenRect]=Screen(screenNumber,'OpenWindow',0,[],[],2);

[cx, cy]=RectCenter(screenRect); %画面の中心

%読み込みと変換

A=imread('sample.jpg');

w = Screen(window, 'MakeTexture', A);

%切り取り部分選択と提示位置指定(画面中央左側)

D=256;

Screen('DrawTexture', window, w, [1,1,D,D],[cx-2*D,cy-D/2,cx-D,cy+D/2]);

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

Discrimination of biological motion patterns in pigeons

2011-11-01 | Education for 3,4年

 

Discrimination of biological motion patterns in pigeons

Michaela Loidolt, Nikolaus Troje, & Ludwig Huber

http://cogbio.univie.ac.at/labs/pigeon-lab/

 

 

cf.

J Exp Anal Behav. 1998 November; 70(3): 281–299.

Categorization Of Natural Movements By Pigeons: Visual Concept Discrimination And Biological Motion.

W Dittrich, S Lea, J Barrett, and P Gurr

http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1284687/

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする