ThinkGear, rawdata and Matlab coding
4 views (last 30 days)
Hi, I am new in Matlab programming, but have experience i Java code, wich is helping but sometimes really confused, questioning if I am coding in correct way. I appriciate any help with my questions. I use similar code https://www.pantechsolutions.net/brain-computer-interface/matlab-code-to-read-raw-eeg-signals-using-mindwave-mobile to read raw data from the headset, and I have several question:
1. How can I found out what data type is inside the Data= zeros(1,1000);
2. In the end of the code there are two rows that free the connection and disconnect. I would like to free the connection and disconnect when I need to do that, like for example when I press letter A on the keyboard.
3. What is the difference between plot(data); and disp(data)? I mean, I understand what they do, but if I place them one after the other, the value in the signal is givin only zeros but plot function will plot the signal with values other than zeros?
4. I need to use this equation on the Data values: (rawdata*(1,8/4096)/2000). Can I write the equation in one row or I need to split it in several steps to get the correct answer? In other words, I guess that Matlab is handling the equation in the correct way, calculating the most important part first when using parantesis?
5. I am using really nice function [s, f, t, ps] = spectrogram(data,window,noverlap,NFFT,Fs,'yaxis' ); wich help me a lot solving many things in one row. I want to plot ps, but ps contains complex numbers. How can I plot ps?
I really appriciate any help in my questions.
madhan ravi on 24 Aug 2018
Edited: madhan ravi on 24 Aug 2018
1) To find what data type just type whos in command window.
2)Didn't understand ,but I guess you can do this by defining it as an input function for example:
DISCONNECT = input('disconnect?')
if size(DISCONNECT) == 1
3)Yes plot function can plot other than zeros.
4)Yes it calculates the most important part inside parantheses.
5)Read the link below: