Multiple things to call into a loop

조회 수: 4 (최근 30일)
Jan
Jan 2012년 4월 16일
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