TMtx::MeanCols Method

void MeanCols(TVec *result);

Calculates the mean value of each of the matrix columns.

#NameTypeDescription
1resultTVec *
Remarks:

Calculate the mean vale of each of the calling matrix columns and store the results in result vector. The and TMtx::Complex properties of the result vector are adjusted automatically.

Examples
#include "MtxVec.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    TMtx* A;
    TVec* res;

    A = new TMtx();
    res = new TVec();
    A->SetIt(2, 2, false, DewArray<double>{1, 5, -3, 6});
    A->MeanCols(res); // res = (-1.0, 5.5)
    A->Free();
    res->Free();
}
See Also: TMtx::MeanRows
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler