How i can filter browse button by some string

3 visualizaciones (últimos 30 días)
Ron
Ron el 20 de Oct. de 2022
Comentada: Ron el 23 de Oct. de 2022

Hey,
i am using App designer and i am trying to open files wit browse button but i'm trying to open only files type " .mat " , and i want to add that i want to be able choose files only starts with some name , for example when i click on Browse button i can see all .mat files , that starts with 'example_PIKO_' .
I know i can find only mat fiels with ->
somePath=uigetdir(pwd,'Select a folder');
files=dir(fullfile(somePath,'*.mat'));

But as you understand it shows all mat files, but i would like to filter also by file name.

Thank you very much.

Respuestas (1)

Kevin Holly
Kevin Holly el 20 de Oct. de 2022
Editada: Kevin Holly el 20 de Oct. de 2022
You can add the name before the * as shown below.
Somename = 'example_PIKO_';
somePath=uigetdir(pwd,'Select a folder');
files=dir(fullfile(somePath,[Somename '*.mat']));
  1 comentario
Ron
Ron el 23 de Oct. de 2022
Well it is not works for me , i used
[file,path]=uigetfile({'example_PIKO_*.mat} , 'select a file','.\example\path');
I can see only files that starts with 'exmaple_piko' but for some reason i can see folders too (somthing i dont want to see)

Iniciar sesión para comentar.

Categorías

Más información sobre Manage Products en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by