Page 1 of 1

About Matlab and the lua p300 speller accumulator

Posted: Wed Jun 07, 2017 2:40 pm
by Ivan Santos
Hello to the community.
I have a problem, I want to get the outputs of the lua accumulator p300 (which are the stimulation of the rows and columns of the P300 array) and use them as inputs in a matlab scripting box for the process function. That is to say that the process function obtains as input the outputs of the lua accumulator P300. However I do not know how to do it. Thank you for your future answers.
The code of the stimulation outputs of the lua speller accumulator is:

box:send_stimulation(1, maxRowIdx + row_base, now, 0)

box:send_stimulation(2, maxColIdx + col_base, now, 0)

And my matlab code for the procces function is:

function box_out = robotarm_process(box_in)

row = box_in.inputs{1}.matrix_data;
col = box_in.inputs{2}.matrix_data;

But I get the following error in openvibe

Reference to non-existent field 'matrix_data'.

Help please, :mrgreen:

Re: About Matlab and the lua p300 speller accumulator

Posted: Thu Jun 08, 2017 7:49 am
by jtlindgren
Hello Ivan,

you can take a look at tuto1_signal_filter_Process.m file bundled with openvibe. There, in the first for() loop of the function, you will see an example how to extract stimulations from the input stream.

Hope this helps,
Jussi

About Matab and the lua p300 speller accumulator, Again

Posted: Thu Jun 08, 2017 4:26 pm
by Ivan Santos
Thanks for the last answer.
Watching the tutorial tuto1_signal_filter_Process and associating it with my matlab processing function
as shown:
function box_out = robotarm_process(box_in)
for i = 1: OV_getNbPendingInputChunk(box_in,2)
[box_in, start_time, end_time, row] = OV_popInputBuffer(box_in,1);
[box_in, start_time, end_time, col] = OV_popInputBuffer(box_in,2);

if(row~=0 & col~=0)
disp(row);
disp(col);
end
end
end
I note that the values ​​obtained are always zero for row and col as shown:
- MATLAB BUFFER - INFO ----
0
0
Therefore I can not go to the next part of the code, What can I do about it?
Maybe the values ​​are of the form 0x00008101 and when printing them on the screen gives zero, if that is the case as I can get the decimal value, since the hex2dec function generates errors
Another question there will be some way to debug the program?

Thanks for your future answers