Minmax: Difference between revisions
Jump to navigation
Jump to search
imported>Lyle No edit summary |
imported>Donal No edit summary |
||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Scale rows or columns of a matrix to range from 0 to 1. | |||
===Synopsis=== | ===Synopsis=== | ||
:[xcorr,mins,maxs] = minmax(x,''options''); | :[xcorr,mins,maxs] = minmax(x,''options''); | ||
===Description=== | ===Description=== | ||
Scales rows (or columns) of | Scales rows (or columns) of a matrix (x) so each row (or column) has a minimum of 0 and a maximum of 1. The option "mode" specifies whether rows or columns are scaled to have unity range. Optional input (options) is described below. | ||
===Inputs=== | |||
* '''x''' = ''M'' by ''N'' matrix of data to be scaled (class "double" or "dataset"). | * '''x''' = ''M'' by ''N'' matrix of data to be scaled (class "double" or "dataset"). | ||
==== | ===Options=== | ||
''options'' = a structure array with the following fields: | ''options'' = a structure array with the following fields: | ||
* '''mode''': [ 1 ] dimension of data on which to calculate the minima and maxima for scaling. 1 = over rows ( | * '''mode''': [ 1 ] dimension of data on which to calculate the minima and maxima for scaling. 1 = over rows (each row will have range [0,1]); 2 = over columns (each column will have range [0,1]). Default is 1. | ||
===Outputs=== | |||
* '''xcorr''' = the scaled data (xcorr will be the same class as x) | * '''xcorr''' = the scaled data (xcorr will be the same class as x) |
Latest revision as of 15:33, 20 November 2018
Purpose
Scale rows or columns of a matrix to range from 0 to 1.
Synopsis
- [xcorr,mins,maxs] = minmax(x,options);
Description
Scales rows (or columns) of a matrix (x) so each row (or column) has a minimum of 0 and a maximum of 1. The option "mode" specifies whether rows or columns are scaled to have unity range. Optional input (options) is described below.
Inputs
- x = M by N matrix of data to be scaled (class "double" or "dataset").
Options
options = a structure array with the following fields:
- mode: [ 1 ] dimension of data on which to calculate the minima and maxima for scaling. 1 = over rows (each row will have range [0,1]); 2 = over columns (each column will have range [0,1]). Default is 1.
Outputs
- xcorr = the scaled data (xcorr will be the same class as x)
- mins = vector of minima for each row (or column)
- maxs = vector of maxima for each row (or column)