MATLAB Answers


How do you match elements in two matrices and call on the rest of the elements in the second matrix after matching?

Asked by Jennifer
on 28 Jun 2013

I have a survey with data that is entered on Excel. The data is entered on a scale of 1 through 5. There are 20 questions. The code is supposed to calculate the score of each person's survey by adding up all the numerical answers from the questions. There is a scoring guide with total scores ranging from 20 through 100. It also includes a measured value and a percentile value. After calculating the total scores of each survey, I want to match the scores from the calculations to the scoring guide. Some of the scores may not match because they are too low, so I want to enter a '0' for those scores. For the scores that do match with a value on the scoring guide, I want to display the score along with the measured value and percentile. This is my code so far:

Data = xlsread('OPUSFunctionalStatusData.xlsx');

TotalScore = zeros(39,1);

 for i = 1:39
    TotalScore(i) = sum(Data(i,5:end)); 

%Match resulting scores from loop to the scoring guide.

Guide = xlsread('OPUSFunctionalStatusScoringGuide.xlsx');

Match = find(ismember(Score,Guide(:,1)))

 %Finds which scores match with a value on the scoring guide.

The data file has 24 columns. The first 4 columns are for identification purposes. Columns 5 through 24 contain the actual data from the survey which is what is needed to calculate the scores. The resulting scores are displayed in a one column vector. The scoring guide contains scores from 20 through 100 with 3 columns (Total score, Measured value, and Percentile). How do I match the calculated scores to the scoring guide and call on the Measured value and Percentiles to display them all together? Any help is appreciated. Thank you!


Log in to comment.

0 Answers

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today