Error message with ttest function & others statistics tests

조회 수: 12 (최근 30일)
SK
SK 2020년 4월 22일
댓글: SK 2020년 4월 22일
Hello,
I enter this simple code (example given by matlab documentation) :
>> load examgrades;
>> x = grades(:,1);
>> y = grades(:,2);
>> h = vartest2(x,y,'Tail','right')
But I have this error message :
Unable to resolve the name statslib.internal.parseArgs.
Error in internal.stats.parseArgs (line 42)
[varargout{1:nargout}] = statslib.internal.parseArgs(pnames,dflts,varargin{:});
Error in ttest (line 104)
internal.stats.parseArgs(okargs,defaults,varargin{:});
It's ok when I write just : h = vartest2(x,y)
I'can't add name-value pair arguments.
I don't understant this error message. have already used this function with my free trial license and I never had a problem before.
Thanks for your solution !

답변 (1개)

Deepak Gupta
Deepak Gupta 2020년 4월 22일
Hello SK,
I just tried your code and didn't face any problems.
load examgrades;
x = grades(:,1);
y = grades(:,2);
h = vartest2(x,y,'Tail','right')
I am using R2019b, can you tell me which version do you have?
You can also try to run this from matlab root directory. To go to root, run cd(matlabroot)
Thanks,
Deepak
  댓글 수: 4
Deepak Gupta
Deepak Gupta 2020년 4월 22일
Are you running this code line by line in command prompt? I think that could be the problem.
Can you try to run this using a script file? Or use live script as given in the example itself. It should run fine
SK
SK 2020년 4월 22일
Yes I have already tried line by line and with a script.
I test an another script and I had the same problem (linear fit):
Unable to resolve the name statslib.internal.parseArgs.
Error in internal.stats.parseArgs (line 42)
[varargout{1:nargout}] = statslib.internal.parseArgs(pnames,dflts,varargin{:});
Error in LinearModel.fit (line 937)
internal.stats.parseArgs(paramNames, paramDflts, otherArgs{:});
Error in fitlm (line 121)
model = LinearModel.fit(X,varargin{:});
Error in reglin (line 21)
mdl=fitlm(x,y);
I don't understand !!!! Should I reinstall matlab ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by