The script runs correctly if I delete the loop and replace i with any value 1-6 in the line ROIData = S(i).ROI_Sig;
Run a loop on struct field
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
DavidL88
il 29 Giu 2020
Modificato: DavidL88
il 4 Lug 2020
Hi
I am running a statistical analysis. I need to run the analysis multiple times for 6 different 'sensortypes'. This data is stored in a 2x1 struct with two fields called S. The data to be inputted is in the secomd field 'ROI_Sig'. Can anyone help with getting the loop to run in the script below?
for i = 1:length(S)
ROIData = S(i).ROI_Sig;
sFiles = bst_process('CallProcess', 'process_test_permutation2', sFiles5 sFiles6, ...
'sensortypes', ROIData, ...
end
Risposta accettata
Neeraj Rajpurohit
il 30 Giu 2020
Hi,
You can use the below mentioned command to get a string array of all the fields in a struct s.
fields = string(fieldnames(s))
Refer to the doc link belowfor more details
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!