EEG Emotiv - Matlab - matlab

Im trying to run the eeglogger or the emotiv Toolbox to record some samples of the EEG Emotiv, but it always show some errors:
Error in EmotivEEG (line 73)
[notfound,warnings] = loadlibrary('edk.dll','edk.h');
%#ok
and If I follow some instructions of forums I can get this:
Warning:
'EE_COGNITIV}EE_EmotivSuite_t;typedefenumEE_ExpressivAlgo_enum{EXP_NEUTRAL=0x0001'
exceeds MATLAB's maximum name length of 63 characters and has been
truncated to
'EE_COGNITIV}EE_EmotivSuite_t;typedefenumEE_ExpressivAlgo_enum{E'.
In edk_proto at 11 In loadlibrary at 379 In eeglogger at 84 Error loading library intermediate output follows. The actual error is
at the end of this output.
No match found for enum value expression EE_ExpressivAlgo_t in
0x0800}EE_ExpressivAlgo_t;typedefenumEE_AffectivAlgo_enum{AFF_EXCITEMENT=0x0001 expression ignored. Found on line 840 of input from line 656 of file
c:\users\marcelo\documents\matlab\EmoStateDLL.h
No match found for enum value expression EE_AffectivAlgo_t in
0x0010}EE_AffectivAlgo_t;typedefenumEE_CognitivAction_enum{COG_NEUTRAL=0x0001
expression ignored. Found on line 840 of input from line 656 of file
c:\users\marcelo\documents\matlab\EmoStateDLL.h
No match found for enum value expression EE_CognitivAction_t in
0x2000}EE_CognitivAction_t;typedefenumEE_SignalStrength_enum{NO_SIGNAL=0
expression ignored. Found on line 840 of input from line 656 of file
c:\users\marcelo\documents\matlab\EmoStateDLL.h
No match found for enum value expression EE_Event_t in
16|32|64|128|256|512|1024}EE_Event_t;typedefenumEE_ExpressivEvent_enum{EE_ExpressivNoEvent=0
expression ignored. Found on line 1993 of input from line 1166 of file
C:\Users\Marcelo\Documents\MATLAB\edk.h
********* Error using loadlibrary (line 423)
There was an error running the loader file. Use the mfilename option
to produce a file that you can debug and fix if needed. Please report
this error to the MathWorks so we can improve this function.
Error in eeglogger (line 84)
[nf, w] = loadlibrary('edk','edk', 'addheader', 'EmoStateDLL', 'addheader', 'edkErrorCode');
Caused by:
Error using struct
Invalid field name "EE_COGNITIV}EE_EmotivSuite_t;typedefenumEE_ExpressivAlgo_enum{E"
I put all files needed in the same folder
Anyone know how can I be able to use emotiv with matlab? and why everyone has the same problems but no confirmed solution?
thanks

Ok as i wrote before and got punished for it, i had the same problem, but i solve it, first of all are you using matlab 32 bits?? otherwise it wont work anything, im using matlab 32 bit 2013, you also need visual studio 32 bit compiler 2010 or older,you need to have all the .dll files on the same folder as well as the edk.h file and set the proper c compiler suing mex -setup, i use the files share by akshaybabloo to acces the emotiv and its working so far.
Note: You must have a research edition Emotiv Epoc otherwise you wont be able to access EEG raw data .

Related

Cannot create plots in Jupyter using Octave

I'm attempting to get Octave working in Jupyter and while I can execute basic math, I cannot get plots to work. Regardless of what type of graphics library I try to use, I get an error similar to this:
error: feval: function '__init_gnuplot__' not found
error: called from
graphics_toolkit at line 98 column 5
Here's the code that faileds:
register_graphics_toolkit('gnuplot');
available_graphics_toolkits()
graphics_toolkit("gnuplot");
I did some investigation and my best guess is that it looks like it's looking for a file called __init_gnuplot__.cc, based on the fact I found a file with a similar name but ends with '-tst'. However, that file doesn't exist and grepping the entire file structure under the octave directory doesn't find any instances of the function in the error.
Has Anaconda removed that functionality? Does anyone know where that '__init_gnuplot__' function is supposed to be located? Or, better yet, does anyone know how to resolve this?

Error using fread Invalid file identifier. Use fopen to generate a valid file identifier

I have a code of a function given by my professor. In his Matlab these function works, but in mine generate these error:
''Error using fread Invalid file identifier. Use fopen to generate a
valid file identifier.
Error in funcrion (line 18) A = fread(fileID ,inf, 'uint8');'''
I think that the problem is the Matlab path, however, I set it before, and I'm sure that is correct. For safety, I add both folders with functions than folders with data.
Thank you

MATLAB deploytool simulink Undefined function 'load_system'

I am using a MATLAB m file code which loads a simulink file, runs it and evaluats it so many times inside a complicated parallel loop.
It runs perfect at MATLAB environment. When compiling the code via deploytool command, installing it and running it from command line, I would have a difficult time.
At the line where it is loading the model,
mymodel= ... ;
load_system(mymodel);
I get the following error
C:\Program Files\mymain\application>Warning: Name is nonexistent or not a directory: model
> In path at 109
In addpath at 86
In run_main at 3
Warning: Name is nonexistent or not a directory: data
> In path at 109
In addpath at 86
In run_main at 4
Warning: Name is nonexistent or not a directory: graphics
> In path at 109
In addpath at 86
In run_main at 5
Starting parallel pool (parpool) using the 'local' profile ... connected to 2 workers.
Initializing ...
Undefined function 'load_system' for input arguments of type 'char'.
Error in run_main (line 40)
MATLAB:UndefinedFunction
I don't care about warnings (as I don't care about most of other MATLAB warnings) however I get error about not recognizing function to open a simulink model ('load_system') :
Undefined function 'load_system' for input arguments of type 'char'.
I did a search and I found the following questions:
load_system using MCR
Deployment of Simulink Models
The first link says
I just got confused: is deployment tools about compiling to C++ or to .NET ?
Is is supposed to increase speed or becomming stand-alone is the only advantage?
The problem with both links is that they talk about strategy. But how to implement them? How can I compile a MATLAB code which uses load_system and sim command to load and simulate a model?
Can anybody bring step by step solution for a very simple example of a MATLAB code (m file) simulating a model and then compiling both of them?
The first sentence of your documentation screen shot is the important one. As mentioned by #Navan (in a comment), Simulink functionality is not compatible with MATLAB Compiler. That is, any m-code that uses Simulink functinality (load_system, sim, etc) will not execute when using the MATLAB Compiler.
Assuming that you have access to Simulink Coder, and that your model doesn't contain functionality that prevents it from being converted to c-code, then your only option is to develop your application in two parts:
With your Simulink model: Use Simulink Coder to create an executable from your model. There are several examples of doing this in the doc, including Using RSIM Target for Batch Simulations. There are various command line options for passing new parameter sets and inputs to the executable via a mat file. The results of the simulation (i.e what would normally be written to the MATLAB Workspace) gets written to a mat file created by the executable.
Within you MATLAB code: replace all Simulink functionality with a call (typically using the system function, as shown in the linked example) to the executable created in step 1. Prior to this call you'll need to create a mat file with all your parameters in it; and after the call you'll want to read results from the mat file created by the executable.
It's not a trivial process, but is do-able.

Getting PottsWheel application for Matlab to create a new model creates an error

I have just installed PottersWheel (latest version) for Matlab (version R2014a) on 64-bit machine. When attempting to use the 'New Model' button I get an error which I have pasted below:
-------------------------------------------
Problem detected at 2014-10-17 14:06:01:
Attempt to reference field of non-structure array.
Line 128 of pwGetFieldWidths.p
Line 170 of pwModel2CellArray.p
Line 126 of pwSaveModel.p
Line 607 of pwCreateModelGUI.p
Line 175 of pwCreateModelGUI.p
Line 95 of gui_mainfcn.m
Line 60 of pwCreateModelGUI.p
Matlab 2014a (mexw64) PottersWheel 3.1.0
-------------------------------------------
Since apparently there is no way to access .p files as they are protected. Does anybody know how to fix this problem?
The .p files are obfuscated MATLAB functions (or kind of object files). So, you cannot edit them. The possibilities are:
You read the documentation carefully, and verify that your arguments obey the requirements;
If #1 fails, you contact the author that holds the source and ask him/her for advice and bug fixing.
If #2 fails, you look for an de-obfucscator/de-compiler.

Matlabs runs wrong script after figure copying

I have the following problem. Let us say, we have some GUI written in Matlab. Let it be
mygui.fig and mygui.m.
OK, now I want to rewrite this gui and keep prev version of it. So, I copy these two files to mygui_new.fig and mygui_new.m.
We all know, that when we run something.fig, Matlab tries to find something.m in order to perform responses on our actions. However, when I'm trying to run my mygui_new.m, Matlab tries to read scripts from mygui.m giving me warnings like:
Warning: Name is nonexistent or not a directory: ..\..\matlab\PostProcess\
In path at 110
In addpath at 87
In mygui at 22
In #(hObject,eventdata)SemiSuperviseTool_main('video_name_popupmenu_CreateFcn',hObject,eventdata,guidata(hObject))
In graphics/private/hgloadStructDbl at 95
In /usr/local/MATLAB/R2013a/toolbox/matlab/graphics/hgload.p>hgload at 70
In openfig at 72
In gui_mainfcn>local_openfig at 286
In gui_mainfcn at 159
In mygui_new at 46
So, we see that Matlab is really starting from my new version of script, but then for some reason tries to load an old one. If I delete old files at all, GUI will not run.
Here is another my post:
No breakpoints after gui figure copying?
The solutions I've described there doest not work here.
Any ideas?
Thanks!
The FIG file stores tags and callbacks that have names tied to the original M file. So, to truly replicate, one has to at least edit those changes for the new FIG file using GUIDE.