Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Run different cases at the same time

tigigitigigi Posts: 2Member
Hi, I'm new to programming and Matlab. I need to make changes to a matlab file. It's a programming analyzing data from different participants in an experiment. The existing programm is written in switch-case, when you key in case 1, it'll just run case 1 for data by participant 1, and it'll show 3 graphs. Now I need to change it to be running 5 cases at the same time and show me 15 graphs at the same time, 3 for each participant. Could anyone help me with it ?

Let me post that part of the programming here. case 99 is to analyze all the data from all participants and will show 3 graphs.

diff = 20; % 30 degree, 0 degree of difference between the 2nd and 3rd digit
subject_no = 1; % 1.ytc 2.ysy 3.ypy 4.ang 5.yhh 6.yty 99.pooling data

switch subject_no
case 1
subj={'ytc'};
trial_num = [1 2 3 4 5];


case 2
subj={'ysy'};
trial_num = [ 1 2 3 4 5];
case 3
subj={'ypy'};
trial_num = [1 2 3 4 5];

case 4
subj={'ang'};
trial_num = [ 1 2 3 4 5 ];

case 5
subj={'yhh'};
trial_num = [ 1 2 3 4 5];

case 6
subj={'yty'};
trial_num = [ 1 2 3 4 5];


case 99 % pool 'ysy' 'ytc' 'yty' 'ypy' 'yhh' 'ang'
subj={ 'ysy' 'ytc' 'yty' 'ypy' 'yhh' 'ang' };
trial_num = [ 1 2 3 4 5];

end
Sign In or Register to comment.