how to delete the files in a folder using matlab?

14 vues (au cours des 30 derniers jours)
kuldeep
kuldeep le 20 Sep 2024
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

Réponses (2)

Stephen23
Stephen23 le 20 Sep 2024
delete(fullfile(inpath,baseGran,'sigma*.img'))

KSSV
KSSV le 20 Sep 2024
Read about delete

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by