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,
About Matlab and the lua p300 speller accumulator
-
- Posts: 7
- Joined: Wed Jun 07, 2017 11:57 am
-
- Posts: 775
- Joined: Tue Dec 04, 2012 3:53 pm
- Location: INRIA Rennes, FRANCE
Re: About Matlab and the lua p300 speller accumulator
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
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
-
- Posts: 7
- Joined: Wed Jun 07, 2017 11:57 am
About Matab and the lua p300 speller accumulator, Again
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
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