How to make the output of a command into the variable for data
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Nadeau Hahne
il 12 Gen 2022
Modificato: Cris LaPierre
il 12 Gen 2022
Hello,
I am using fileparts to extract the file names and use that as the variable for the data in the struct below. How do I make output "Patient001" as the variable name for the struct that is currently called "PatientData"? without having to manually doing it. Eventually I want to be able to loop through hundreds of patient files.
Thank you
file = "Patient001.pdf";
[pathstr,PatientName,ext] = fileparts(file)
PatientName =
"Patient001"
PatientData = {1, 2, 3, 4}
0 Commenti
Risposta accettata
Cris LaPierre
il 12 Gen 2022
Modificato: Cris LaPierre
il 12 Gen 2022
You might also be interested in the RenameField function, available on the File Exchange (created by a community member).
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Structures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!