I don't know why 'mean' function couldn't run with 'double'

I want to use 'mean' function in a code, but it results the error:Undefined function 'mean' for input arguments of type 'double'.
So I checked the funtion with the example on matlab website (https://www.mathworks.com/help/matlab/ref/mean.html)
>> A = [0 1 1; 2 3 2; 1 3 2; 4 2 2]
A =
0 1 1
2 3 2
1 3 2
4 2 2
>> a=mean(A)
Undefined function 'mean' for input arguments of type 'double'.
It shows the same error message, even I use the example on Matlab website.
I don't know what's wrong with it..

 Respuesta aceptada

madhan ravi
madhan ravi el 21 de Dic. de 2018
Editada: madhan ravi el 21 de Dic. de 2018
Maybe the case that you have a file named mean.m if so change it's name or delete it .
which mean -all % what shows up?

7 comentarios

Jiyeon Kim's answer moved here for consistency:
C:\Program Files\MATLAB\R2018b\toolbox\matlab\timefun\@datetime\mean.m % datetime method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\timefun\@duration\mean.m % duration method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\bigdata\@tall\mean.m % tall method
C:\Program Files\MATLAB\R2018b\toolbox\distcomp\parallel\@codistributed\mean.m % codistributed method
C:\Program Files\MATLAB\R2018b\toolbox\distcomp\gpu\@gpuArray\mean.m % gpuArray method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\timeseries\@timeseries\mean.m % timeseries method
These functions showed up ,,, but ,,can I change name of it or delete it?
Don't change anything they are inbuilt functions.
You are missing this file though which you really need:
/Applications/MATLAB_R2018b.app/toolbox/matlab/datafun/mean.m
Can u tell me where I can get the function?
It's better you contact the mathworks support team by clicking the Contact Us button on the top right corner of this page , they will definitely help you out.
First you should check your Search Path, as it might just be that someone/something has changed the Search Path and so MATLAB simply cannot find that function, even if if exists in your MATLAB installation.
Okay Thank you so much :)
Anytime :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 21 de Dic. de 2018

Comentada:

el 21 de Dic. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by