Howdy, Stranger!

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


Finding the maximum value of different variables for a number of participants

LJudsonLJudson LeedsMember Posts: 1


I have data for nine participants and four different variables (Right Knee, Left Knee, Right Ankle and Left Ankle) which I have imported into matlab.

I want to find the maximum value for each variable and each participant. I have written the following script:

for joint_num = 1:4

if joint_num == 1
    joint = 'LAnkle';
elseif joint_num == 2
    joint = 'RAnkle';
elseif joint_num == 3
    joint = 'LKnee';
elseif joint_num == 4
    joint = 'RKnee';

File = ['TorqueData_',joint,'_Isom'];

MaxT = max (TorqueData_LAnkle_Isom);
MaxT = max (TorqueData_RAnkle_Isom);
MaxT = max (TorqueData_LKnee_Isom);
MaxT = max (TorqueData_RKnee_Isom);


However, when I run the script, instead of getting a table of four rows and nine columns with the maximum values of each variable, I get one row of nine columns, with the maximum values of the last variable (RKnee).

I'm sure this is something simple but I am new to matlab and really struggling! If anyone could helpt it would be very much appreciated.

Thanks and Best Wishes

Sign In or Register to comment.