Switch to unified view

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