필터 지우기
필터 지우기

Index exceeds the number of array elements

조회 수: 1 (최근 30일)
Zeynep Fatma
Zeynep Fatma 2023년 5월 4일
답변: Cris LaPierre 2023년 5월 4일
fullFileName = fullfile(dicomFolder, dicomFiles(2).name);
dicomInfo = dicominfo(fullFileName);
grayImage = dicomread(dicomInfo);
fullFileName = fullfile(jpegFolder, jpegFiles(363).name);
grayImageJpeg = 255*imread(fullFileName);
When I change the dicom file number or jpeg file number, I got always index exceeds the number of array elements error. Index must not exceed 0 but I don't know how to solve this problem.

답변 (1개)

Cris LaPierre
Cris LaPierre 2023년 5월 4일
The error would suggest that dicomFiles and jpegFiles are empty.
You haven't shared the code that creates those variables, so we can't offer much help other than to say that when they are created, they are not assigned any values.
A = [];
A(1)
Index exceeds the number of array elements. Index must not exceed 0.

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by