Hello,
in the initialize.m function for this module i use the next code:
global bci_Parameters bci_States;
global h_im h CH_N CH_MAP tamBloq;
SampleRate= int8(str2double( bci_Parameters.SamplingRate));
tamBloq= int8(str2double( bci_Parameters.SampleBlockSize));
%Error 1
if(1==1)
error( 'SampleRate %s',int2str(SampleRate))
end
%Error 2
if(1==1)
error( 'Tambloq %s',int2str(tamBloq))
end
I have to mention that i did not use both errors together, i commented one to see what the other one showed and inverse ( i do not know an easier way to show values in BCI2000 log actually). While error2 shows 32 (the value i have in the configuration)m error1 always prints 0 (it should print 256).
Aren´t they both supposed to be bci_Parameters values? What could be causing this?
Thanks.
Problem getting SampleRate with MatlabSignalProcessing module
-
- Posts: 19
- Joined: 07 Sep 2016, 20:03
-
- Posts: 19
- Joined: 07 Sep 2016, 20:03
Re: Problem getting SampleRate with MatlabSignalProcessing module
Sorry i did not mention it before, but i am using a compiled version of BCI2000 of the actual trunk source code. Perhaps it is related to the compilation not being done correctly? I do not think it is an error from the .m code i am using, it must come from BCI2000.
Re: Problem getting SampleRate with MatlabSignalProcessing module
lsegura003,
The issue in your code is that the str2double function expects a number in the bci_Parameters.SamplingRate variable, e.g., '120', but in reality this variable has the unit 'Hz' attached, i.e., '120Hz'. To overcome this issue use, 'sscanf(bci_Parameters.SamplingRate,'%i')' in your code. Also please note that the int8 function will cap your value at 127.
Regards, Peter
The issue in your code is that the str2double function expects a number in the bci_Parameters.SamplingRate variable, e.g., '120', but in reality this variable has the unit 'Hz' attached, i.e., '120Hz'. To overcome this issue use, 'sscanf(bci_Parameters.SamplingRate,'%i')' in your code. Also please note that the int8 function will cap your value at 127.
Regards, Peter
-
- Posts: 19
- Joined: 07 Sep 2016, 20:03
Re: Problem getting SampleRate with MatlabSignalProcessing module
Ouch, you get me again!
I did it this way finally:
str=strjoin(bci_Parameters.SamplingRate);
B = regexp(str,'\d*','Match');
SampleRate= B{1}; %First number
Thanks man.
I did it this way finally:
str=strjoin(bci_Parameters.SamplingRate);
B = regexp(str,'\d*','Match');
SampleRate= B{1}; %First number
Thanks man.
Who is online
Users browsing this forum: No registered users and 24 guests