/*------------------------------------------------------------------------------* * File Name: NormalizeAllYColumns.c * * Creation: ER, 02/07/05 * * Purpose: Programming Example * * Copyright (c) OriginLab Corp.2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 * * All Rights Reserved * * * * Modification Log: * *------------------------------------------------------------------------------*/ #include //////////////////////////////////////////////////////////////////////////////////// // This function normalizes the data in all Y columns, dividing the column values // by the max value found in the column. // void normalize_all_y_columns() { Worksheet wks = Project.ActiveLayer(); if( !wks ) { out_str("Active layer is not a worksheet!"); return; } foreach( Column col in wks.Columns ) { if( OKDATAOBJ_DESIGNATION_Y == col.GetType() ) { Dataset ds(col); double dMin, dMax; ds.GetMinMax(dMin, dMax); ds /= dMax; } } } ////////////////////////////////////////////////////////////////////////////////////