readimage function throws error in MAtlab 2018a

조회 수: 3 (최근 30일)
Nandagopalan Venugopalan
Nandagopalan Venugopalan 2018년 5월 18일
댓글: Nandagopalan Venugopalan 2018년 5월 18일
readimage function with a pixelLabelDatastore argument Throws error
Error using whos
Must be a string scalar or character vector.
Error in categorical/subsref (line 20)
whos (s.subs{:})
Error in matlab.io.datastore.PixelLabelDatastore.label2cat (line 851)
C = categoricalCache(uint16(L)+1);
Error in matlab.io.datastore.PixelLabelDatastore/label2categorical (line 789)
C{i} = matlab.io.datastore.PixelLabelDatastore.label2cat(...
Error in matlab.io.datastore.PixelLabelDatastore/readimage (line 502)
C = this.label2categorical(C, info);
Error in Main_2 (line 14)
C = readimage(pxds,1);
  댓글 수: 2
Guillaume
Guillaume 2018년 5월 18일
Can you give the output of:
content = strsplit(fileread(fullfile(matlabroot, 'toolbox', 'matlab', 'datatypes', '@categorical', 'subsref.m')), '\n', 'CollapseDelimiters', false);
content{20}
which is basically line 20 of categorical/subsref. Have you edited that file by mistake?
Nandagopalan Venugopalan
Nandagopalan Venugopalan 2018년 5월 18일
Pls find the output below. I haven't edited the particular file.
content = strsplit(fileread(fullfile(matlabroot, 'toolbox', 'matlab', 'datatypes', '@categorical', 'subsref.m')), '\n', 'CollapseDelimiters', false);
content{20}
ans =
' whos (s.subs{:})'

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

답변 (1개)

Guillaume
Guillaume 2018년 5월 18일
For some reason, the content of categorical/subsref.m (true path of the file is the output of fullfile(matlabroot, 'toolbox', 'matlab', 'datatypes', '@categorical', 'subsref.m')) has been edited. Line 20 of that file is not what it should be. it looks like somebody was trying to debug the file and left some debug code there. That debug code makes no sense as in most cases it will error and in the rare cases where it doesn't, will output nonsense.
As it's unknown what else has been modified, I would recommend you reinstall matlab unfortunately.
And of course, never modify matlab own m files.
  댓글 수: 1
Nandagopalan Venugopalan
Nandagopalan Venugopalan 2018년 5월 18일
Hi Guillaume
Thank You... Will do the suggested and keep posted!

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

카테고리

Help CenterFile Exchange에서 Time Series Collections에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by