I want to modify a task where the 2nd target appears and then stays on until it is reached to. I would like to "flash" the target for x ms. The target would appear briefly, then one would move to where they think they saw the target. Can this be accomplished through the model explorer or somewhere else? If so, how specifically.I have found how to modify the TP table where I could potentially create another row for this, but after it is created, then what? Is there an example I can used to guide me?
Hi BBL, The columns in the TP table are defined in the Parameter Table Defn block. If you add a new entry in the TP table tab, it will create a new column in the TP table. One way to do what you are asking for is that it sounds like your program has a state where the target appears (this would involve writing 1 to the state input of the Show Target Block). To turn off the target, you could use temporal logic to transition to a state where the state input to the Show Target Block is 0. That way everything is the same but the now the target is off. For the transition between the "target is on" and "target is off" state, you can use the after keyword (https://www.mathworks.com/help/stateflow/ug/using-temporal-logic-in-state-actions-and-transitions.html). The transition condition would look after(tickCount, e_clk). In an earlier state, you can set tickCount to be amount of ms that you want to wait (here is where you would refer to the TP table. You would have tickCount = Trial_Protocol[DELAY_COLUMN] - where I've assumed your new column is called DELAY_COLUMN]). e_clk is an event that is already inside your Stateflow diagram. It is a signal that oscillates between 0 and 1 at 1 kHz (ie. it's a 1 kHz clock). You could look at our reaching task example (https://kinarm.com/download/reaching-sample/). It has some timing sections in the context of "stay this long in a target" that show timed state transitions. It also has changing of target states between states 0, 1, 2, where 0 is off and 1 and 2 are defined in the sample task as the target being green and the target being red. Let me know if I can answer anything else! Koloman
Please login or Register to submit your answer