Opening a mdf file in matlab - matlab

I used to use tool to convert those mdf files to .mat, but apparenlty the developer hasn't updated it. It does not work any more.
Is there any other tool with which i can convert to .mat file or directly load and open the .mdf file?
error:
Attempt to reference field of non-structure array.
Error in mdfimport>Load_MDF_File_Callback (line 603)
cd (handles.pathName); % Change to current or last
directory looked at
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in mdfimport (line 87)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating uimenu Callback

For reference: if you have MATLAB R2016b or later, and your MATLAB licence includes the Powertrain Blockset or the Vehicle Network Toolbox, you can use the mdf function to read MDF files.

Related

Script running problem/error - Matlab 2019b

I get this error in Matlab
Attempt to execute SCRIPT feature as a function:
E:\feature.m
Error in images.internal.isFigureAvailable (line 9)
if feature('showFigureWindows')
Error in imtool (line 172)
if ~images.internal.isFigureAvailable()
Error in Untitled (line 8)
imtool close all; % Close all imtool figures.
Error in run (line 91)
evalin('caller', strcat(script, ';'));
It does not matter which code I run it always shows up. How can I solve it?
MATLAB has a built in function called feature. imtool is internally trying to call this function, but instead a script you placed on E:\feature.m is called. Delete or rename your feature.m.

using xlswrite inside a loop and an error when using mac

I am trying to use the xlswrite inside a loop to put the results in each iteration
my function is like this
xlswrite('results',results(1,i).A,'results',data);
I get the following errors,
Error using xlswrite (line 187)
An error occurred on data export in CSV format.
Error in myalgorithm (line 178)
xlswrite('results',results(1,i).A,'results',data);
Caused by:
Error using dlmwrite (line 112)
The input cell array cannot be converted to a matrix.
I am using Matlab 2015b and also I am using mac
I also tried to use csvwrite instead xlswrite but no success. is there any one who can help me with it?

How to replace the wavread(file) in matlab r2015a

I am trying to run a matlab script and in the line [s, fs] = wavread(file);,
I take the following result,
Warning: WAVREAD will be removed in a future release. Use AUDIOREAD
instead. In wavread (line 62) In MEDanalysis (line 25) Error using
wavread (line 70) Invalid Wave File. Reason: Cannot open file.
Error in MEDanalysis (line 25)
[s, fs] = wavread(file);
You have 1 warning and one error:
The Warning is about using waveread which will be removed in future versions of MATLAB.
If you want your code to compatible with newer versions of MATLAB, use audioread.
The error says something about your wave file being corrupted. Can you play it in VLC for instance?

TMG matlab tool error

I am trying to generate a tf-idf representation of a text file using TMG matlab tool.
This is how I set up my variables:
When I press continue, I get the following error.
Undefined function or variable 'new_sprintf'.
Error in tmg_p
Error in tmg (line 124)
if nargout==8, [varargout{1}, varargout{2}, varargout{3}, varargout{4}, varargout{5}, varargout{6}, varargout{7},
varargout{8}]=tmg_p(varargin{1}, varargin{2}); end
Error in tmg_gui>ContinueButton_Callback (line 456)
[A, dictionary, global_weights, normalization_factors, words_per_doc, titles, files, update_struct]=tmg(filename, OPT);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in tmg_gui (line 27)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>#(hObject,eventdata)tmg_gui('ContinueButton_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
And the environment path changes to: log_files
What's causing this and how can I fix it?
I had this problem too: you have to add the path of TMG to MATLAB before using it.
I had this problem, but installing MATLAB 2013a or 2012b and using an earlier verion of tmg solved my problem.

Data across GUI, Matlab

So i tried to share GUI data using setappdata and getappadata. for example lets consider this
matfile1.m
h = EmotivEEG;
h.Run
for k = 1:4
out(:,:,k) = h.data + rand(1);
setappdata(0,'eegData', out(:,:,k);
pause(0.5);
end
h.delete
so the above file creates a 128x14 matrix every o.5 seconds and store it in eegData
matfile2.m
some_var = getappdata(0,'eegData')
plot(some_var)
this seems to work but not while in the loop, if i ask it to plot it i get this error
Error using setappdata
Too many output arguments.
Error in eeg_live>eeg_live_OpeningFcn (line 83)
lmno = setappdata(0,'eegData');
Error in gui_mainfcn (line 221)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in eeg_live (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in Neucube>activation_Callback (line 3963)
eeg_live
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in Neucube (line 49)
gui_mainfcn(gui_State, varargin{:});
Error in #(hObject,eventdata)Neucube('activation_Callback',hObject,eventdata,guidata(hObject))
Error using pause
Error while evaluating uicontrol Callback
any idea on how to tackle this problem.
thanks in advance.
There seems to be some problems with your code, but the line that MATLAB tells you generates the error is not in the snippet you provided, and the message is quite clear:
Using this command (line 83):
lmno = setappdata(0,'eegData');
is forbidden because setappdata does NOT accept output arguments, therefore the error is thrown. You can only use an assignment with getappdata.
Other points to consider:
1) Make sure you use the same variable name with get/setappdata (i.e. either eegdata or eegData...it might be a typo though)
2) You don't seem to call the 2nd script in your loop, so setappdata is overwriting the value of eegData at every iteration.
Hope that helps!