Grab a file without writting full name
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to grab a file that is always located in same folder that starts with the name "Target" and ends with ".hex" but in front of Target there is a version number that can change.
In the following line you can see I'm trying to use the " * " to pick up any file. But this doesn't work. Anyone can help me how to do this?
firmwareFile = [basePath{1} '..\binaries\Target*.hex'];
0 comentarios
Respuestas (1)
Kevin Holly
el 19 de Oct. de 2022
Editada: Kevin Holly
el 19 de Oct. de 2022
Can you try this?
folder = [basePath{1},filesep,'binaries']; % I'm assuming this is the folder location
firmwareFiles = dir(fullfile(folder,'Target*.hex'))
11 comentarios
Kevin Holly
el 20 de Oct. de 2022
To detect if it is empty:
isempty(firmwareFiles)
To detect how many files were detected:
size(firmwareFiles,1)
Ver también
Categorías
Más información sobre Package and Share Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!