Calculating and extracting data from three dimensional array
Show older comments
Well I need to find the following things:
1. calculate the average score for each question, using all the data.
2. Extract data for question 3 for each year and create an array that compares question 3 from year 1 and year 2.
This is what i have so far:
%Create array of first and second year data
year1 = [3,6,4,10;5,8,6,10;4,9,5,10;6,4,7,9;3,5,8,10];
year2 = [2,7,3,10;3,7,5,10;4,5,5,10;3,3,8,10;3,5,2,10];
%Create 3-D array with two pages
testdata = cat(3,year1,year2)
%Calculate average for each question for each year in array
average = mean(testdata)
I'm not sure how to calculate the average of both arrays into one, and extract column 3 (question 3) from each year into one array. I know how to extract them separately but after that i don't know how to combine them. Any help would be great!
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!