Get data from input data range, then put it to matrix
bool get_data_from_dr_to_mat( const DataRange & dr, matrixbase & mat, bool bRemoveMissingRows = true, bool bRemoveMissingCols = true )
Return true for success, otherwise false .
EX1
void get_data_from_dr_to_mat_Ex1() { Worksheet wks; wks.Create("origin"); Dataset ds1(wks,0); Dataset ds2(wks,1); ds1.Data(1,20,1); ds2.Data(20,1,-1); DataRange dr; dr.Add(wks, 0, "X"); dr.Add(wks, 1, "Y"); matrix mData; BOOL bRet = get_data_from_dr_to_mat(dr, mData); if(bRet) { MatrixLayer ml; ml.Create(); MatrixObject mo; mo = ml.MatrixObjects(); matrixbase& mat = mo.GetDataObject(); mat = mData; printf("The matrixLayer will show the data that matrix gets from datarange\n"); } else printf("Failed to get\n"); }
get_xy_data
origin.h