how to delete the files in a folder using matlab?

10 ビュー (過去 30 日間)
kuldeep
kuldeep 2024 年 9 月 20 日
回答済み: Stephen23 2024 年 9 月 20 日
I have assigne the input path as
inpath = 'C:\SAR';
and baseGran = S1A_IW_GRDH_1SDV_20240823T005527_20240823T005552_055333_06BF4D_21CD
and now i want to delete the sigma*.img files in the folder using my matlab code
C:\SAR\S1A_IW_GRDH_1SDV_20240823T005527_20240823T005552_055333_06BF4D_21CD
I tried like
delete('inpath/baseGran/sigma*.img');
but it did not work.
PLease suggest me how to delete the sigma*.img files in this folder
kuldeep

回答 (2 件)

Stephen23
Stephen23 2024 年 9 月 20 日
delete(fullfile(inpath,baseGran,'sigma*.img'))

KSSV
KSSV 2024 年 9 月 20 日
Read about delete

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by