Index exceeds the number of array elements
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
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)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!