out of range subscript while training. Error is like sub2ind.
3 次查看(过去 30 天)
显示 更早的评论
I have labelled my folders in a numerical sequential manner. The files in that folders are being used to train my algorithm. The labels have been extracted automatically from the folder names. I think the way matlab reads the folders is different than how i save them in my computer. After the matlab reads the files their order changes. Does it have somthing to do with the error ? The error pops right at training command, "out of range subscript", Error in "sub2ind".
0 个评论
回答(1 个)
Sai Pavan
2023-10-11
Hi Purvesh,
I understand that you are trying to know whether the order of folders is causing the “out of range subscript” error when using “sub2ind” function.
The order in which MATLAB reads the files from a folder can indeed be different from the order in which they are saved on your computer. This can be due to various factors, such as the operating system's file system or the way MATLAB retrieves file information.
It is unlikely that the "out of range subscript” error is directly related to the file order issue. This error typically occurs when trying to access elements outside the valid range of an array or matrix. You may want to review your code and check for any indexing errors or issues with the dimensions of your data when using the “sub2ind” function.
Please refer to the below documentation to learn more about the “sub2ind” function: https://www.mathworks.com/help/matlab/ref/sub2ind.html
Hope it helps.
Regards,
Sai Pavan
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!