TMG matlab tool error - matlab

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.

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.

Opening a mdf file in 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.

How to fix the Principle Component Analysis error in Matlab

I happened to a Matlab Problem, the error looks like this:
Error using pca
Too many input arguments.
Error in mdscale (line 413)
[~,score] = pca(Y,'Economy',false);
Error in demo_libsvm_test1 (line 140)
newCoor = mdscale(distanceMatrix,2);
When I debug my code step by step, the error comes from here:
distanceMatrix = pdist(heart_scale_inst,'euclidean'); (line 139)
newCoor = mdscale(distanceMatrix,2); (line 140)
Everything above the two lines are all right. I do not know how to fix the problem. I use Matlab 2014a. Can anyone give me a help?

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!

Matlab compatibility? What is wrong?

I'm using a Matlab code for data analysis (fitting of scattering data), which is written in 2006. This code works with Matlab 2007 well, but at least it doesn't work in Matlab 2009 and newer versions. Therefore I think it is caused by some changes in the runtime environment concerning how to act with GUIs.
In following I post the error message I always get:
Illegal right hand side in assignment. Too many elements.
Error in Frontend>do_fit (line 749)
[handles.fitfunctions{fitfunction_index}.param_vector,
handles.data_fit, exitflag, output] = ...
Error in Frontend>fit_button_Callback (line 673)
do_fit(hObject, handles);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in Frontend (line 42)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating uicontrol Callback
Lines 747 to 750 in my function "do_fit" in frontend.m look like:
fitmethods = Fit();
fitmethod = fitmethods{2}.func;
[handles.fitfunctions{fitfunction_index}.param_vector, handles.data_fit,
exitflag, output] = ...fitmethod((#(A,z)fitfunction(const,A,z)), fitparams, xdata,
ydata, lb_vector, ub_vector, weightdata ,options);
I would be very thankful, if someone has an idea what is wrong in this piece of code!