Hello.
I am wanting to load images which end with the following sequence numbers as shown in pat.
pat=["0001","0016","0032","0048"]
This is my code:
for i=1:n;
filename = list{i}; % Convert from cell array to string
[~,baseFileNameNoExt, extension] = fileparts(filename);
tf = endsWith(baseFileNameNoExt,pat);
... Do stuff
end
But rather than hard code pat in this code, I'd like to be able to enter it in an editfield so I can change it through my GUI (Appdesigner)
I've tried entering this in the editfiled
"0001","0016","0032","0048"
But it doesnt match the actual format of pat
pat =
1×4 string array
"0001" "0016" "0032" "0048"
How can I use the edit box as an imput to get the correct format for pat?

 채택된 답변

Jason
Jason 2026년 1월 8일

0 개 추천

Ive answered it myself.
Use this in the editfield box
'0001 0016 0032 0048'
then do this:
s=app.PatternEditField.Value
pat = string(split(s)')

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Just for fun에 대해 자세히 알아보기

제품

릴리스

R2024b

질문:

2026년 1월 8일

답변:

2026년 1월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by