Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
what will code line 2 and 3 will do in below code? fprintf('\nInitializing...\n'); %1 strArray = java_array('java.lang.String', numberOfImagesToProcess);%2 for k = 1 : numberOfImagesToProcess%3 File1 = [imagesFolder '\'];%4 File = [imageFiles
조회 수: 1 (최근 30일)
이전 댓글 표시
fprintf('\nInitializing...\n'); %1
strArray = java_array('java.lang.String', numberOfImagesToProcess);%2
for k = 1 : numberOfImagesToProcess%3
File1 = [imagesFolder '\'];%4
File = [imageFiles(k).name];%5
strArray(k) = java.lang.String(File);%6
end
댓글 수: 0
답변 (1개)
Guillaume
2016년 11월 18일
Why don't you ask the author or whoever gave you that code?
The code store the names of the files into a java array. Only the author can tell you why they decided to store them in a java array as opposed to matlab's built-in arrays (2d char array or cell array of 1d char arrays).
Only the author can also tell you why they waste time recalculating a constant in the loop.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!