How i can filter browse button by some string
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
Kevin Holly
2022년 10월 20일
편집: Kevin Holly
2022년 10월 20일
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']));
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!