Endwith pattern using editfield
32 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jason
el 8 de En. de 2026 a las 10:30
Respondida: Jason
el 8 de En. de 2026 a las 11:24
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?
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!