Info

この質問は閉じられています。 編集または回答するには再度開いてください。

what will code line 2 and 3 will do in below code? fprintf('\​nInitializ​ing...\n')​; %1 strArray = java_array​('java.lan​g.String', numberOfIm​agesToProc​ess);%2 for k = 1 : numberOfIm​agesToProc​ess%3 File1 = [imagesFolder '\'];%4 File = [imageFiles

1 回表示 (過去 30 日間)
Kanwal Kaur
Kanwal Kaur 2016 年 11 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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

回答 (1 件)

Guillaume
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.

この質問は閉じられています。

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by