Data Collection and Classification for the Development of a Sailing Performance Evaluation System

Page 125

B.8

Scale Normalization.m

% Copyright (c) 2013 Ryan Sammon. % All rights reserved. % Start timer. tic; cpu_tic = cputime; % Merge data from all runs. temp = []; for ii = 1:size(Run,2) temp = vertcat(temp, Run(ii).Input); end % Find minimum and maximum values. min_val = min(temp,[],1); max_val = max(temp,[],1); % Loop through all runs. for ii = 1:size(Run,2) % Loop through columns. for jj = 1:size(Run(ii).Input,2) % Rescale. Run(ii).Input(:,jj) = (Run(ii).Input(:,jj)-min_val(jj))... /(max_val(jj)-min_val(jj)); end end % Record time. Scale_Normalization_Time = toc; Scale_Normalization_CPU_Time = cputime-cpu_tic; % Clean up cell. clearvars ii jj temp min_val max_val cpu_tic

115


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.