Multiple things to call into a loop

4 次查看(过去 30 天)
I define the subject numbers like this:
subno={'s_01', 's_02','s_03', 's_04', 's_05', 's_06','s_07', 's_08', 's_09', 's_10','s_11', 's_12', 's_13', 's_14','s_15', 's_16', 's_17', 's_18','s_19', 's_20', 's_21', 's_22','s_23', 's_24', 's_25', 's_26', 's_27','s_28', 's_29','s_30', 's_31', 's_32', 's_33', 's_34', 's_35', 's_36', 's_37','s_38', 's_39'};
Each of the .vhdr and .eeg files of each subjects are stored within these files. So I need to ask the script to first enter each of these one by one. I did it like this:
for p=1:length(subno)
%defining paths
MAIN = '/data/janani/EoA/rawdata';
PATHIN=[MAIN, '/subno{p}'];
PATHOUT=[MAIN, '/EKGanalysis/'];
But when I run even just this much it says the letter ´p´ is an unknown variable even though I´ve defined that it is the number of items in subno array. What is wrong with what I´ve written? How can I make it understand that ´p´ is supposed to code for s_01 and s_02 and so on in that order?
Thank you!

采纳的回答

Andrei Bobrov
Andrei Bobrov 2012-4-16
['/',subno{p}] instead of '/subno{p}'

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by