Returns a table value with the first column r being the radius and the second a being the angle of x and y converted to polar coordinates.
If only a single argument is given, its must have two columns and the first will be assumed to be x and the second y.
Returns a table value with the first column being the x value and the second being the y of the radius r and angle a converted to cartesian coordinates.
If only a single argument is given, its must have two columns and the first will be assumed to be r and the second a.
Returns a column array with the summations of the values in each row of x. If x is a table value, then all the numeric columns must have the same unit dimensions, but string columns are simply ignored.
However if a second argument is given as a string, then that string is used as a column name for the sums and a table value is returned. Also in this case if x is a table value, any string columns are copied into the result as well.
If a does not have the same number of elements as b, then the smaller number must be divisible into the larger without a remainder and those values will be duplicated appropriately to match with the larger number of values.
If a and b are tables, they must have the same number of rows and columns and have the same column types. A table of results will be returned using a's column names.
If a does not have the same number of elements as b, then the smaller number must be divisible into the larger without a remainder and those values will be duplicated appropriately to match with the larger number of values.
If a and b are tables, they must have the same number of rows and columns and have the same column types. A table of results will be returned using a's column names.
If a does not have the same number of elements as b, then the smaller number must be divisible into the larger without a remainder and those values will be duplicated appropriately to match with the larger number of values.
If a and b are tables, they must have the same number of rows and columns and have the same column types. A table of results will be returned using a's column names.
If a does not have the same number of elements as b, then the smaller number must be divisible into the larger without a remainder and those values will be duplicated appropriately to match with the larger number of values.
If a and b are tables, they must have the same number of rows and columns and have the same column types. A table of results will be returned using a's column names.
If a does not have the same number of elements as b, then the smaller number must be divisible into the larger without a remainder and those values will be duplicated appropriately to match with the larger number of values.
If a and b are tables, they must have the same number of rows and columns and have the same column types. A table of results will be returned using a's column names.
If a does not have the same number of elements as b, then the smaller number must be divisible into the larger without a remainder and those values will be duplicated appropriately to match with the larger number of values.
If a and b are tables, they must have the same number of rows and columns and have the same column types. A table of results will be returned using a's column names.
If the first argument is a scalar then:
Returns true (the value 1) if the first value (index 1,1) of every argument is non-zero. If any element is unknown, then the result is unknown as well. If a zero value is encountered, then the values for the remaining arguments (left to right) will not be evaluated.
If the first argument is not a scalar then:
All the arguments are evaluated and they must all have either the same number of elements as the first argument or be scalars. The result will be a numeric value of the same size as the first argument, with each value set to 0.0 unless the comparable elements of all the arguments are nonzero. Scalar arguments will use their single value to compare with all element positions.
If the first argument is a scalar then:
Returns the value of the first argument whose first element (index 1,1) is non-zero. If an element is encountered with an unknown value, then the result is unknown as well. In either case the remaining arguments are not evaluated.
If the first argument is not a scalar then:
All the arguments are evaluated and they must all have either the same number of elements as the first argument or be scalars. The result will be a numeric value of the same size as the first argument, with each value set to 1.0 unless the comparable elements of all the arguments are zero. Scalar arguments will use their single value to compare with all element positions.
Creates a new object which contains all the columns of all the arguments. All arguments must have the same number of rows.
If all of the columns aren't the same type (numeric, string or table) or if numeric and they have different unit dimensions, then a table value will be returned.
Returns a string or numeric matrix with r rows and c columns with all elements initialized to the value of i. If only two arguments are supplied, they are assumed to be r and i with the number of columns being 1.
Thus {cell -3, 1} when evaluated for a cell at row 10 and column 4, would return the value of the cell at row 7 and column 5.
Returns a column array with all of the values of the arguments concatenated together. Matrices are first converted to arrays on a row by row basis. See the redim function if you wish to convert the result back into a matrix.
When the arguments to concat are table values, all arguments must have the same number and type of columns. In the resulting table each column will be the concatenation of the respective columns of the arguments. The name and display unit for each column will be taken from the first argument.
Short form of concat.
Attempts to return the eigenvector(s) for square matrix a, corresponding to the eigenvalue(s) in v. If there is more than one eigenvalue, the result will be a matrix with each column containing the corresponding eigenvector. If a vector cannot be found, that column will be zero filled.
Eigenvectors cannot be calculated for eigenvalues with nonzero imaginary components.
If a is a table value, then a table value will be returned that is displayed with the columns being rows and rows being columns. This just for display and does not affect how the value is referenced or how functions and operations act upon it.
If the second parameter is 0 or missing, this will be the scalar average of all the values of x. If it is 1, then the result is a column vector whose values will be the averages of each row of x. If it is 2, then it will be a row vector of averages of the columns of x.
Returns the median of the values of x. If the second parameter is 0 or missing, this will be the scalar median of all the values of x. If it is 1, then the result is a column vector whose values will be the medians of each row of x. If it is 2, then it will be a row vector of medians of the columns of x.
Returns the geometric mean of the values of x. If the second parameter is 0 or missing, this will be the scalar geometric mean of all the values of x. If it is 1, then the result is a column vector whos values will be the geometric means of each row of x. If it is 2, then it will be a row vector of geometric means of the columns of x.
Returns the harmonic mean of the values of x. If the second parameter is 0 or missing, this will be the scalar harmonic mean of all the values of x. If it is 1, then the result is a column vector whose values will be the harmonic means of each row of x. If it is 2, then it will be a row vector of harmonic means of the columns of x.
Returns the calculated variance for the sample x. Note that the unit type for this will be the square of the unit type of x. The square root of this is the standard deviation.
If the second parameter is 0 or missing, this will be the scalar variance of all the values of x. If it is 1, then the result is a column vector whose values will be the variance of each row of x. If it is 2, then it will be a row vector of variance of the columns of x.
Returns the natural logarithm of the gamma function for x, where x > 0. Note that where x is an integer, then gamma x is equal to (x - 1)!. Thus for calculations that involve division of large factorials that might overflow, subtracting the ln gamma values might be a better alternative.
Returns the number of permutations of k objects that can be selected from a population of n objects, where the order of selection is significant.
Returns the number of combinations of k objects that can be selected from a population of n objects, where the order of selection is not significant.
Returns the normal distribution for x, given a mean u and standard deviation s, where all three have the same unit type. If argument c is missing or is equal to 0, then a cumulative distribution is returned. If it is present and non-zero, then the probability mass function is returned.
Returns the inverse of the normal distribution function for probability p, given a mean u and standard deviation s, where the mean and standard deviation must have the same unit type.
Returns the binomial distribution probability for n trials with s successes p probability of success on each trial.
The result will have the maximum rows and columns of any of the parameters, with smaller parameters having their values reused as necessary.
Returns the cumulative beta probability density function for x (which must be 0 <= x <= 1) and the a (alpha) and b (beta) parameters.
The result will have the maximum rows and columns of any of the parameters, with smaller parameters having their values reused as necessary.
Returns the one tailed probability of the chi-squared distribution. The x2 value should be the chi squared value and df should be the degrees of freedom. See also the chitest function.
Calculates the chi squared value and degrees of freedom from the actual and expected values in matrix values a and e respectively. These are then used with the chidist function to calculate the probability that the accepted values could match the expected values. Normally the a and e values should have the same number of rows and columns, but if they don't, the a sizes are used with values being reused as necessary.
Uses the Student T test to determine the probability that two populations with an assumed equal variance have the same mean. Returns the two tailed distribution value.
Uses the paired Student T test to determine the probability that two populations with an equal number of elements and variance paired by sample have the same mean. Returns the two tailed distribution value.
Alternatively pairs of names and values can be used as in
{table "First", x1, "Second", x2}
and so forth.
In either case, the value arguments should all have the same number of rows. If there are fewer names than values or vice versa, the lessor number is used and the extras are ignored.
Finally if there is only a single string argument starting with the word "table", then the argument is assumed to be CSV data of the form described in the Data Table help and a table value is constructed from it.
Returns a column array with the summations of the values in each row of x. If x is a table value, then all the numeric columns must have the same unit dimensions, but string columns are simply ignored.
However if a second argument is given as a string, then that string is used as a column name for the sums and a table value is returned. Also in this case if x is a table value, any string columns are copied into the result as well.
(concat can be abbreviated to just cc)
Returns a column array with all of the values of the arguments concatenated together. Matrices are first converted to arrays on a row by row basis. See the redim function if you wish to convert the result back into a matrix.
When the arguments to concat are table values, all arguments must have the same number and type of columns. In the resulting table each column will be the concatenation of the respective columns of the arguments. The name and display unit for each column will be taken from the first argument.
Creates a new object which contains all the columns of all the arguments. All arguments must have the same number of rows.
If all of the columns aren't the same type (numeric, string or table) or if numeric and they have different unit dimensions, then a table value will be returned.
The t argument must be a table value and the c argument a string value with the name of a column in that table. The result is a table where the first column will contain all the unique values of that designated column. The other columns will be the sums of the rows that share that unique value. String columns are ignored.
The t argument must be a table value and the c argument a string value with the name of a column in that table. The result is a table where the first column will contain all the unique values of that designated column. The other columns will be the maximums of the rows that share that unique value. String columns are ignored.
The t argument must be a table value and the c argument a string value with the name of a column in that table. The result is a table where the first column will contain all the unique names of that designated column. The other columns will be the minimums of the rows that share that unique value. String columns are ignored.
Rows will be selected from the "from" argument, which can be a string, number or table value.
The "selector" can be either a numeric or string value. If it is a numeric value, it should have a single column and the same number of rows as the "from" value. The returned value will consist of all the rows of "from" for which the corresponding row value of "selector" is nonzero.
Alternatively if the "selector" value is a string value, then each row should consist of a query of the form
"column op value"
where column is the name of the column if "from" is a table or the number of the column if it is a numeric or string value. The "op" term is one of ("=", "!=", "<", "<=", ">", ">=", "?", "*"). The "value" term is some value that will be matched against each row of the column using the given operation. The value isn't a formula, but can have a unit if it is numeric. String comparisons are case insensitive and if the value is omitted it will match an empty or blank filled string.
The "?" operator means contains and only works with string values.
The "*" selects the column value if it matches the regular expression in value. It also only works with string values.
If the selector has more than one row, or multiple terms separated by a new line or comma, each result while be "ANDed" with the previous result, unless the "column" term is preceded by a "|" character. In that case an OR operation is performed with the previous result. An "&" character can optionally be used for AND operations to make the formula more descriptive.
Selector xamples might be:
If a is a table value, then a table value will be returned that is displayed with the columns being rows and rows being columns. This just for display and does not affect how the value is referenced or how functions and operations act upon it.
Returns a string representing the t table value argument in Comma Separated Value format.
If a string value is included as the second argument, it will be used as the separator instead a comma.Note - this function assumes the values to be in increasing order
Returns a row array with two columns. The first column holds the row numbers of the first cell found in in, which has the same value as the first value of x. The second column holds the column number of that cell.
The cells are scanned row by row, with the first match being returned. If none of the cells match, then a zeroes are returned.
If x is not a scalar, then the process is repeated for each value of x, with the result being in the corresponding row of the returned value.
Rows will be selected from the "from" argument, which can be a string, number or table value.
The "selector" can be either a numeric or string value. If it is a numeric value, it should have a single column and the same number of rows as the "from" value. The returned value will consist of all the rows of "from" for which the corresponding row value of "selector" is nonzero.
Alternatively if the "selector" value is a string value, then each row should consist of a query of the form
"column op value"
where column is the name of the column if "from" is a table or the number of the column if it is a numeric or string value. The "op" term is one of ("=", "!=", "<", "<=", ">", ">=", "?", "*"). The "value" term is some value that will be matched against each row of the column using the given operation. The value isn't a formula, but can have a unit if it is numeric. String comparisons are case insensitive and if the value is omitted it will match an empty or blank filled string.
The "?" operator means contains and only works with string values.
The "*" selects the column value if it matches the regular expression in value. It also only works with string values.
If the selector has more than one row, or multiple terms separated by a new line or comma, each result while be "ANDed" with the previous result, unless the "column" term is preceded by a "|" character. In that case an OR operation is performed with the previous result. An "&" character can optionally be used for AND operations to make the formula more descriptive.
Selector xamples might be:
Formats a number x, using the format string f, optionally using a display unit.
The x value can be a numeric scalar, array or matrix.
The f parameteris a format string is styled on C format string and typically is of the form:
%12.4f
which says the field should be 12 characters wide with 4 characters after the decimal point in normal floating point format.
If c is used instead of f, the numbers will have commas added (e.g. 1,234,567.89).
An e can be used instead of the f for exponential format (e.g. 1.23457e+6).
You can even show numbers with an arbitrary base between 2 and 36. For instance a value could be represented in hex with %14.16x.
For the date units (date, dated, datem), you can use a / or - and that character will be used to separate the month, day and year. If the dated or datem units are being used, prefix the whole format with a d or m so it is the last four digits that are grouped as the year.
Note it is also permissable to omit the size number, i.e. %.2f would be fine and the number would just be right justified.
If the third parameter, u, is used, it must be the name of a unit compatible
with the unit type of x.
Thus function
{fmt "%12.2f", 12.1234}
would return
12.12
,
while
{fmt "%12.2f", 12.1234, "%"}
would return
1212.34).
Returns a string value containing HTML that can be used to display the value of v.
Joins the elements of string array s into a single string, with the elements separated by the
scalar string sep. If s has more than one column and more than one row, the result will be a
column array with each row of s joined.
Also when s is a matrix, an optional third paramater can be supplied, in which case the second
parameter is used to join the columns and the third parameter is used to join the rows, resulting in a
scalar string.
The s parameter must be a string consisting of legal JSON code. The result is a Math Minion JsonValue.
Splits the elements of string s into an array string, using the scalar string sep
as the separator. If s isn't a scalar, the result will one row per value of s, with each value split
into columns. The number of columns will be determined by the number of splits of the first element.
Also an optional third paramater can be supplied, in which case the second parameter is used to separate
the columns and the third parameter is used to separate the rows, resulting in a string matrix. In this
case, only the first value of s is used.
If no separator is supplied, then the first element of s will be split into a single array of individual characters.
A regular expression search is performed on the elements of s using the regular expression
rx, with the matched portions of the strings being returned. If a match is not found, then an empty
string "" is returned for that element.
The rx value does not need to be a scalar and the normal row order repeating is used for mismatched sizes.
A regular expression replacement is performed on the elements of s using the regular expression
rm to match and rr to replace. The transformed result is returned (s is not modified).
If a match is not found, then an empty string "" is returned for that element.
The rm and rr values must have the same number of elements, but do not have to be scalars
or the same size as s.
Returns a string matrix of the same size as s, but consisting of sub-strings of the elements of s.
The number b is the position of the first character of the substring in s and l is
the length of the substring. If l is not supplied or is greater than the number of characters
available, the substring will consist of all the characters after position b. If b and
l are not the same size as s, their values will be reused as necessary until all the elements
of s are processed.
If the b value is negative it will be the position from the end of the string. That is -1 would be the last
character in the string.
Finds the first occurrence of the regular expression f in the elements of string s. The result is a matrix with a number of rows equal to the total number of elements in s and two columns. The first column will contain the position in the s element of the beginning of f and the second column will contain the length of the found string. If f is not the same size as s, its values will be reused as necessary until all the elements of s are processed.
If the string is not found in a given element, the position for that element will be 0.
Returns a numeric matrix of the same size as s, but with each element having the length of the corresponding element of s.
A string is returned where all the uppercase characters of s have been replaced with their lowercase equivalents.
A string is returned where all the lowercase characters of s have been replaced with their uppercase equivalents.
If a is a string, then the first element is converted to UTF8 bytes, which are returned as a numeric array with one byte value per element.
If a is a numeric value, then all the elements are assumed to be UTF8 byte values an a single element string value is constructed from them.
Applies the 4x4 transformation matrix in the first parameter to the x, y and z coordinates in the second parameter. The number of elements in the coordinates parameter must be a multiple of 3 and typically coords is a matrix with one or more rows, with x, y and z columns.
The result is a matrix the same size as coords, with the transformation applied to each group of 3 elements.
Returns a unit value with the default base conversion unit x.
For instance {baseunit 60 mph} would return a value of 1 m/s.
This function is disabled by default for security reasons. It can be enabled in code on a private server.
Executes the first argument c, which must be a string value, as Javascript code. If c has more than one element, only the first is evaluated. Additional arguments are optional and are converted to Javascript objects that the code can access.
The last calculated object is converted into an appropriate Math Minion value.
If other arguments in addition to the code value are supplied, they are converted into Javascript objects and made available to the code in an array named "mm_args". String and numeric values will be converted into objects with "unit", "columns" and "values" elements as described above, while table values will be converted to arrays as also described above.
Note that for anything other than the simplest expressions, it is probably best to create the Javascript code in a separate expression using a beginning single quote to designate everything following as a string. This simplifies dealing with single and double quotes in the code.
Returns a numeric matrix value of x. If x is already numeric it is simply returned.
If x is string value, then an attempt is made to interpret its values as numbers and if that isn't possible, a zero is used in its place.
If x is a table value, then all of the columns must be of the same unit dimensions. String columns are ignored.
Creates a matrix with nr rows and nc columns and with all elements set to random numbers between 0 and 1.
If the column argument is omitted, it is assumed to be 1 and if both arguments are omitted, they are both assumed to be 1.
If x is a table value it will be sorted on column number n.
If n is omitted, the first column is used. If n is negative, the sort is reversed
If x is a table value the sort will be on its column number n.
If n is omitted, the first column is used. If n is negative, the sort is reversed
This uses XMLHttpRequest to perform net requests, but note that Cross Origin Resource Sharing (CORS) policies will probably prevent its use with servers you don't control.
The method and url arguments are what is passed to the request's open method. The headers argument, if supplied, should be a string matrix with the first column containing any header names and the second header values. A string array will also work with names and values alternating. This is passed to the request's setRequestHeader method.
The return value is the request responseText.