Error in Matlab code
조회 수: 2 (최근 30일)
이전 댓글 표시
I have attached a picture of my code with error message. It was working yesterday and now it is giving me an error and I don't know why. Everything should be in the same file/directory.
If I delete the num2str(i) in line 15 it works but I need this command to run through all the .mat files in my directory and for some reaosn just stopped working. The 4 2d_simple_array_run files each contain the .mat file.
Any help would be appreciated.
댓글 수: 0
채택된 답변
Cris LaPierre
2021년 3월 9일
The error message is correct.
Your path points to a folder onscale1. However, the folder appears to be just onscale.
댓글 수: 2
Cris LaPierre
2021년 3월 9일
Look at line 15 in your code. The result can be seen in the red error message "Unable to read file...".
Your code is inserting your loop counter into the folder name. This is changing the path to be to a folder that doesn't exist. Remove the num2str(i), and your code should work.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!