Unzipping using system command ? I couldn't understand the command
1 回表示 (過去 30 日間)
古いコメントを表示
someone wrote this and he said it was very helpful
sys_cmd_unzip = @(z,d) ['"C:\Program Files\7-Zip\7z.exe" e -y -r -o"' d '" "' z '" *'];
cellfun(@(z,d) system(sys_cmd_unzip(z,d)), all_zip_files, new_zip_file_dirs,'uniformoutput',false)
but the problem is that I couldn't understand this line:
@(z,d) ['"C:\Program Files\7-Zip\7z.exe" e -y -r -o"' d '" "' z '" *'];
what does this do '"C:\Program Files\7-Zip\7z.exe" e -y -r -o"' d '" "' z '" *' and what is z and d? can anyone help me with this please?
Thank you
0 件のコメント
採用された回答
Rik
2018 年 7 月 19 日
The cellfun function is used to apply a function each element of your cell array. By providing two cell arrays, the function is applied to each corresponding element.
In this case, the defined function takes in two inputs, where the first is named z and the second d. That means that z is the zip file name and d is the directory. The function then concatenates the several string parts, so it becomes a valid command.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!