what is the correct inputs for cv.basicfacerecognizer - matlab

I am trying to provided sample code for cv.facerecognition in mexopencv - Matlab, but i am getting an error in cv.facerecognition which says
Undefined function or variable 'BasicFaceRecognizer_'.
Error in cv.BasicFaceRecognizer (line 131)
this.id = BasicFaceRecognizer_(0, 'new', ftype, varargin{:});
I couldn't find any solution for that, i appreciate your support
thanks

Related

Issues related to SVR in MATLAB

I am working on support vector regression for aerospace applications. I need to implement SVR in MATLAB. On the internet, I found this link, which gives detailed information with examples. When I try running the example codes in matlab, I am getting this error,
Error using classreg.learning.FitTemplate/fillIfNeeded (line 604)
OptimizeHyperparameters is not a valid parameter name.
Error in classreg.learning.FitTemplate.make (line 124)
temp = fillIfNeeded(temp,type);
Error in RegressionSVM.template (line 349)
temp = classreg.learning.FitTemplate.make('SVM','type','regression',varargin{:});
Error in RegressionSVM.fit (line 343)
temp = RegressionSVM.template(varargin{:});
Error in fitrsvm (line 235)
obj = RegressionSVM.fit(X,Y,varargin{:});
I am using MATLAB R2016a. Kindly let me know, how to solve this issue.
I had a similar issue today. Just upgrade Matlab to Matlab 2016b and it should work. Maybe it's a new parameter that they just introduced.

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.

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!