Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

transpose matrix c++ vectors

vector<vector<double>> outtrans(out[0].size(),
                                    vector<double>(out.size()));
    for (size_t i = 0; i < out.size(); ++i)
        for (size_t j = 0; j < out[0].size(); ++j)
            outtrans[j][i] = out[i][j];
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #transpose #matrix #vectors
ADD COMMENT
Topic
Name
5+4 =