Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Jack_23

Junior Member
Registered:
Posts: 21
Reply with quote  #1 
Hi, I have a question about ml2.
I need to present a picture for 1000ms. And at 500 ms of the picture presentation, I need to give a stm which though analog output. How to do this. Please give me some hint. Thank you very much. 
0
Jaewon

Administrator
Registered:
Posts: 492
Reply with quote  #2 
----- beginning of the example code -----
toggleobject(1,'eventmarker',10);  % picture on
idle(500);
toggleobject(2,'eventmarker',20);  % stimulation on
idle(500);                         % may need an adjustment
toggleobject(1,'eventmarker',30);  % picture off

idle(1000);
----- end of the example code -----

You may want to adjust the second 500-ms idle interval to, like, 490 ms to make the total picture time exactly 1000 ms, since tuning on the stimulation takes a little time.

0
Jack_23

Junior Member
Registered:
Posts: 21
Reply with quote  #3 
Thank you, Jaewon. 
Since tuning on the stimulation takes a little time, while, the stimulation start time needs to be precise in this experiment. I wonder whether I can use this code to do this.

----- beginning of the example code -----
toggleobject([1 2],'eventmarker',10);  % picture on

idle(1000);

toggleobject(1,'eventmarker',30);  % picture off
----- end of the example code -----

In the .mat file for stm, I set the 'y' value like [0 0 0 0 0 ... 5 0 5 0]. Since the early part of 'y' elements are all 0, which likes the analog output nothing, I can set the time period of this part by considering the frequency. 
I am not sure whether toggleobject([1 2],'eventmarker',10) would make pic and stm start at the same time? Could I use  this way to achieve the time precision between pic and stm? Thank you.

0
Jaewon

Administrator
Registered:
Posts: 492
Reply with quote  #4 
Yes, you can use them in that way. The pic and stm will start at the same time.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.