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

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.

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?

How can I determine the version of a MAT file from MATLAB?

I am wondering if there is a way to determine whether a particular MAT file is v4, v6, v7 or v7.3?
I am looking for a solution that can determine the version using MATLAB code, preferably without having to load the data into memory.
There is some comment at the beginning of mat-files version 6 or following. This code reads it:
function txt=getMatComment(x)
fid=fopen(x);
txt=char(fread(fid,[1,140],'*char'));
txt=[txt,0];
txt=txt(1:find(txt==0,1,'first')-1);
end
It seems the comment is always 116 chars long, but I did not find any reference. This code reads 140 chars and cuts of at the end.
The part I don't understand: For Version 6 or 7 it says MATLAB 5.0 MAT-file

EEG Emotiv - 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 .

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.

Including a DLL into Gnu Octave

On this page I found an interesting implementation for fingerprinting of digital pictures. It is written in MATLAB, therefore I downloaded GNU Octave and tried to run the example.
But I get the error
'mdwt' undefined near line 47 column 14
error: called from 'NoiseExtract' in file C:/Users/......../CameraFingerprint/Functions\NoiseExtract.m
near line 47, column 12
There is a hint on the webpage above:
Q: Do I need any additional packages or libraries?
A: You need discrete wavelet transforms such as those included in
\Filter directory as dll (developed by Markus Lang from Rice
University). These .dll run under 32-bit Windows only. You may need to
recompile them uder your operating system if different.
So I got the .dll-Files, but how do I use them and the functions inside?