Mask or unmask a range of worksheet cells
wcellmask irng:=[Book1]Sheet1!Col(2)
Please refer to the page for additional option switches when accessing the x-function from script
Input
Range
int
Option list:
This function is used to set cell(s) mask in specified range.
This script demonstrates the use of rowstats and wcellmask X-Functions to perform descriptive statistics on rows and mask the cell whose value is defined as outlier.
// create a new book and import data file newbook sheet:=1; string fname$ = system.path.program$ + "Samples\Graphing\Contour.dat"; impASC; // get number of columns and rows int nCols = wks.nCols; int nRows = wks.nRows; // turn off Spreadsheet Cell Notation firstly page.xlcolname = 0; // add two columns for mean and sd wks.addCol(Mean); wks.addCol(SD); // perform row stats rowstats -r 0 irng:=col(1)[1]:col($(nCols))[nRows] mean:=col(Mean) sd:=col(SD); // mask outlier for(int ii=1; ii<=nRows; ii++) { double dLower = col(Mean)[ii]-col(SD)[ii]; // mean-sd double dUpper = col(Mean)[ii]+col(SD)[ii]; // mean+sd for(int jj=1; jj<=nCols; jj++) { double dOutlier = col($(jj))[ii]; // get cell value if(dOutlier<dLower || dOutlier>dUpper) { wcellmask irng:=col($(jj))[ii]; // mask the cell } } }
For the Spreadsheet Cell Notation in the workbook, please see FAQ-849 for more information.