[b4b313]: / Semantic Features / NotUsed / GetGroupedMatrix.m

Download this file

23 lines (22 with data), 728 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function [ GroupedMatrix ] = GetGroupedMatrix( InputMatrix, ratingRow )
%GroupedMatrix Converts matrix from raw format to concatenated format
% Takes an X or Y matrix and ratingRow(which describes how many rows per
% nodule) and puts all the data from the related group on the same line
% (can be modified if we want 1 1 1 2 2 2 instead of 123 123 123)
j = 1;
i = 1;
del = 3;
while i <= size(InputMatrix,1)
if i == ratingRow(3)
del = del-1;
end
if i == ratingRow(2)
del = del-1;
end
if i == ratingRow(1)
del = del-1;
end
GroupedMatrix(j,1:(del+1)*size(InputMatrix,2)) = reshape(InputMatrix(i:i+del,:)', 1,[]);
i = i + del + 1;
j = j+1;
end