How do I write a script that increments along a dataset header
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I've got one large dataset that consist of a number of trials. The trials include numerous different units in two different conditions (pre and post treatment,) each with multiple variables. I'd like to create a script that runs analysis on each unit between the pre and post groups, something like
ttest((mean(data.variable1(data.unit=='unit1' & data.treatmentstatus=='Pre Treatment'))), mean(data.variable1(data.unit=='unit1' & data.treatmentstatus=='Post Treatment')))
How can frame this in a script such that it automatically increments along the different unit titles ('unit1', 'unit2', ..., then variable1, variable2, ..., etc)
Thanks!
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 23 Jan. 2013
Please remember to use strcmp() to compare strings, not "=="
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!