Is there a path in the string?
Mostra commenti meno recenti
hi,
a: example: f='\report\
b: example =f='c:\root\report\
how can i identify the string with case "a" or with "b"?
in the case 'a' i see a folder..
in case 'b' i see a path with folder
5 Commenti
Govind KM
il 16 Giu 2023
Can you explain your question in a bit more detail?
Mathieu NOE
il 16 Giu 2023
why looking for ':/' char array would not be professionnal ?
shamal
il 19 Giu 2023
Mathieu NOE
il 20 Giu 2023
why something simple could not be used ?
Risposte (1)
Fangjun Jiang
il 16 Giu 2023
1 voto
You can utilize the exist() function.
Assume you are at the c:\root folder, and there is a \report sub-folder
exist('\report','dir') will return 0
exist('c:\root\report','dir') will return 7, since 'c:\root\report' is the full path of a folder.
Please note, exist('report','dir') will also return 7.
Categorie
Scopri di più su File Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!