'grp2idx' error in matlab 2011b

I receive the "Undefined function 'grp2idx' for input arguments of type 'double'." error while using svmtrain() in 2011b. Incidentally, I also have matlab2010a but observed that I do not get this error while running the command with the 2010a version. I noted that the statistics toolbox folder is present in both versions. What is the problem and how do I overcome it?
thanks
Vivek

답변 (2개)

Walter Roberson
Walter Roberson 2012년 2월 11일

0 개 추천

It should exist.
Please check
which -all grp2idx
on both systems. On my R2008b system it shows up as toolbox/stats/grp2idx.m

댓글 수: 7

vivek n
vivek n 2012년 2월 12일
Thank you Walter. I got " 'grp2idx' not found." for my 2011b version, and "C:\Program Files\MATLAB\R2010a\toolbox\stats\grp2idx.m" for my 2010a version.
I dug up the path to gr2idx.m in my 2011b folder and found it at "C:\Program Files\MATLAB\R2011b\toolbox\stats\stats". Unlike its 2010a counterpart, the '2011b\toolbox\stats' folder contains 'classreg','stats', and 'statsdemos' folders. I tried re-installing the 2011b, but it didn't help.
How should I proceed?
Vivek
Tom Lane
Tom Lane 2012년 2월 12일
Try explicitly adding the required directories to your path
addpath([matlabroot '/toolbox/stats/stats'])
addpath([matlabroot '/toolbox/stats/statsdemos'])
addpath([matlabroot '/toolbox/stats/classreg'])
vivek n
vivek n 2012년 2월 12일
Thank you Tom. This fix worked, as expected. Was this bug already known? My concern is whether 2011b could throw up other such unexpected errors because of its file organization. Is there an alternative,more stable version of 2011b?
Tom Lane
Tom Lane 2012년 2월 12일
I'm not aware of any bug in the product that would cause this. It appears to be either an installation problem, or some phenomenon that caused your pre-R2011b path to be saved and used without update in R2011b.
vivek n
vivek n 2012년 2월 13일
I did not get any errors during installation. To verify, I completely uninstalled all versions of Matlab, downloaded the 64-bit version of 2011b from Mathworks a short while ago (2/13/2012), and re-installed it from scratch. The installation was successful this time too. But I still get the same error as before ("Undefined function 'grp2idx' for input arguments of type 'double'.")....
Tom Lane
Tom Lane 2012년 2월 13일
Would you try
which pathdef -all
and let me know what you see?
vivek n
vivek n 2012년 2월 13일
I got the result below:
..\My Documents\MATLAB\pathdef.m
C:\Program Files\MATLAB\R2011b\toolbox\local\pathdef.m % Shadowed

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

wahyu
wahyu 2012년 11월 27일

0 개 추천

i have the same problem too,, then, i search in google grp2idx.m, then i saved it, alhamdulillah my svmtrain could work well after that :D may be my instalation is not complette.

카테고리

제품

질문:

2012년 2월 11일

편집:

2013년 10월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by