I want to read a bunch of files inside a loop function in MATLAB, but when I try the following code:
조회 수: 1 (최근 30일)
이전 댓글 표시
j = (i * 2000000);
A = dlmread('gr_at_0.l_%d', j);
I get the following error:
Error using sprintf
Invalid format.
Error in dlmread (line 71)
delimiter = sprintf(delimiter); % Interpret \t (if necessary)
Error in RDF (line 15)
A = dlmread('gr_at_0.l_%d', j);
the following file is one of the many files that I want to read:
'''gr_at_0.1_0'''
I would appreciate any comment.
댓글 수: 0
답변 (1개)
per isakson
2021년 4월 29일
편집: per isakson
2021년 4월 29일
What do you suppose that the following statement will do?
j = (i * 2000000);
Replace
A = dlmread('gr_at_0.l_%d', j);
by
A = dlmread(sprintf('gr_at_0.l_%d',j));
댓글 수: 2
per isakson
2021년 4월 29일
It works here on my R2018b.
What code did you run and what error messge did you get?
참고 항목
카테고리
Help Center 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!