Undefined function 'normalize' for input arguments of type 'double' - matlab

I want to use the MATLAB function "normalize" which normalizes the data to zero mean and unit variance. During the compilation, I still get the error:
Undefined function 'normalize' for input arguments of type 'double'.
Although this function support double inputs.
When I typed:
which normalize -all
I got:
C:\Program Files\MATLAB\R2017a\toolbox\signal\signal\#dfilt\normalize.m % dfilt method
Could any one help me please?

You're likely using a version of MATLAB older than R2018a, which is when the function normalize was first introduced. The which command is showing you a normalize method for dfilt class objects (from the Signal Processing Toolbox) that existed prior, which only accepts arguments of type dfilt.

Related

Why is fgoalattain built-in function not working in MATLAB?

I'm trying to invoke an fgoalattain function (computing a function minimum with a goal-attainment algorithm) in MATLAB. According to documentation, it should look like this:
[X,FVAL,ATTAINFACTOR] = FGOALATTAIN(#objf_1,x0,goal,weight)
where #objf_1 is a function handle for a function defined in objf_1 m-file and the rest are some arguments I set on my own. They are not important in any case, because evidently MATLAB has a problem with that function, as it throws:
>> rospar_4
Undefined function 'fgoalattain' for input arguments of type 'function_handle'.
Error in rospar_4 (line 29)
[X,FVAL,ATTAINFACTOR] = fgoalattain(#objf_1,x0,goal,weight)
However, I already know that the function works fine on another MATLAB version - R2011b (the one I'm using is R2012b), but with first argument as char instead:
[X,FVAL,ATTAINFACTOR] = fgoalattain('objf_1',x0,goal,weight)
If I try to invoke it like this in mine though, the error is almost the same:
>> rospar_4
Undefined function 'fgoalattain' for input arguments of type 'char'.
Error in rospar_4 (line 29)
[X,FVAL,ATTAINFACTOR] = fgoalattain('objf_1',x0,goal,weight)
Any idea how am I getting this?
It is not a built-in function. You need to install the Optimization toolbox.

Error in MATLAB.Undefined function 'det' for input arguments of type 'embedded.fi'

I have already seen the link Error using fzero in Matlab: Undefined function or method 'det' for input arguments of type 'function_handle'
But I am unable to solye my problem with this link.I am working with fi object in MATLAB. I have one matrix T_1 (2 cross 2) which is conevrted into the fi(T_1,1,32,26,fimath), i.e 32 signed binary number and 26 is the positon of binary point. Now when I try to excute the follwing code
T = mat_G/(mat_sqrt_D)
T_1=fi(T./mat_E,1,32,26,fimath);
multiplier=1/(2*sqrt(det(var_oldS))*abs(det(T_1)));
follwing error appears
Undefined function 'det' for input arguments of type 'embedded.fi'.
So can anyone tell me how can i fix it.
P.S variable var_oldS, mat_G,mat_E, mat_qrt_D has the same fi object properties i.e fi(variable_name,1,32,26,fimath)
If you check the documentation for det, it says that the input must be single or double. Fixed point is probably not supported. As your matrix is of fixed size 4, it's simple to replace the function:
det2=#(M)M(1)*M(4)-M(2)*M(3)
Then use det2 instead of det.

Matlab arctanh function

I keep receiving an error while using the arctanh function on Matlab
Undefined function arctanh for input arguments of type 'double'.
I am doing this calculation
A = mu*arctanh(l2./(R2+R3))
Where l2 and R2 are vectors.
arctanh is only in MuPAD Notebook Interface:
http://www.mathworks.com/help/symbolic/mupad_ref/arctanh.html
Normally within MATLAB you should use atanh:
http://www.mathworks.com/help/matlab/ref/atanh.html

Matlab Error: Undefined function 'knnclassify' for input arguments of type 'double'

I am trying to do knnclassify on test_data(10000X784), train_data(50000X784), train_label(50000X1) and k = 1
And I am calling this function as follows:
label = knnclassify(test_data,train_data,train_label,k);
Background:
Where train_label is numeric equivalent digit of the data given in train_data. I want to classify my test_data. The data in both the train and test are in random order, but the train_label totally corresponds with the data in the train_data.
In my friend's workstation it works fine, but in my laptop it gives this error:
Undefined function 'knnclassify' for input arguments of type 'double'.
What could be the reason for the issue and how to solve it? Do I need to install any package? If yes how?
This error means that the function cannot be found in matlab, so you might missing the required toolbox. Just as #schorsch said you need to install the Bioinformatics toolbox.
A way to find out if the function is available in Matlab is typing which knnclassify. The output will be the route where the function resides or 'knnclassify' not found. otherwise.

which format can I give to imstack2vectors Matlab function?

So I have imported RGB photo into my Matlab workspace. It says it has value: <200x200x3 uint8>. Meaning it has class uint8. And its name is: prettyPic. So when I try to do the following:
% Convert prettyPic to vector format using function imstack2vectors.
[prettyPic, L] = imstack2vectors(prettyPic);
I get the following error:
??? Undefined function or method 'imstack2vectors' for input
arguments of type 'uint8'.
I was searching google all around reading the Matlab help and even trying to give 'imstack2vectors' different types of variables only to find that none works.
So the question is what type of picture should I feed the 'imstack2vectors' with. And how can I convert the picture that I have to that format/class.
I am a begginer in Matlab so any help would be greatly appreciated!
??? Undefined function or method 'imstack2vectors' for input arguments of type 'uint8'.
Means that most likely, the function imstack2vectors does not exist on your Matlab path (i.e Matlab cannot find a function of this name).
Type which imstack2vectors to see whether Matlab can find it on the path. If it returns nothing, but you know where the function is on your hard drive, you can change directories in Matlab to where the function is located, and then run your command again.
In general, you may want to learn about adding functions to the Matlab path.