Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.