Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1494
Number of posts: 2174

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Run different cases at the same time Posted by tigigi on 3 Jan 2013 at 6:34 PM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.