Home > . > ndraws.m

ndraws

PURPOSE ^

NDRAWS - make random draws on information from file

SYNOPSIS ^

function [simId, ampl, startSamp1, startSamp2, int1, int2, ext1, ext2,ext3] = ndraws(nSim, tempList)

DESCRIPTION ^

 NDRAWS - make random draws on information from file

 [simId, ampl, startSamp1, startSamp2, int1, int2, ext1, ext2, ext3] ...
       = ndraws(nSim, tempList)

 nSim      number of draws to make on tempList
 tempList  cell array containing all data read from file

 simId         signal types
 ampl          signal amplitudes
 startSamp1    minimum start times in samples
 startSamp2    maximum start times in samples
 int1          first internal angles
 int2          second internal angles
 ext1          first external angles
 ext2          second internal angles
 ext3          third internal angles

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [simId, ampl, startSamp1, startSamp2, int1, int2, ext1, ext2, ...
0002         ext3] = ndraws(nSim, tempList)
0003 
0004 % NDRAWS - make random draws on information from file
0005 %
0006 % [simId, ampl, startSamp1, startSamp2, int1, int2, ext1, ext2, ext3] ...
0007 %       = ndraws(nSim, tempList)
0008 %
0009 % nSim      number of draws to make on tempList
0010 % tempList  cell array containing all data read from file
0011 %
0012 % simId         signal types
0013 % ampl          signal amplitudes
0014 % startSamp1    minimum start times in samples
0015 % startSamp2    maximum start times in samples
0016 % int1          first internal angles
0017 % int2          second internal angles
0018 % ext1          first external angles
0019 % ext2          second internal angles
0020 % ext3          third internal angles
0021 
0022 % $Id: ndraws.m,v 1.2 2004/05/10 20:26:12 stuver Exp $
0023 
0024 % DETERMINE number of rows in tempList
0025 % DRAW nSim times on the lines of tempList
0026 % RETURN variable lists
0027 
0028 mTempList = size(tempList, 1); % Number of rows (simulations) in tempList
0029 if mTempList == 0
0030     error('makelist -> ndraws: tempList has zero length')
0031 end
0032 
0033 % Make nSim draws on tempList
0034 for iSim = 1:nSim
0035     % Select row from tempList to put into nuTempList
0036     nuTempList(iSim,:) = tempList(fix(rand(1)*mTempList)+1,:);
0037     % Assign variables from nuTempList
0038     simId(iSim,:) = nuTempList{iSim,1};
0039     ampl(iSim,:) = nuTempList{iSim,2};
0040     startSamp1(iSim,:) = nuTempList{iSim,3};
0041     startSamp2(iSim,:) = nuTempList{iSim,4};
0042     int1(iSim,:) = nuTempList{iSim,5};
0043     int2(iSim,:) = nuTempList{iSim,6};
0044     ext1(iSim,:) = nuTempList{iSim,7};
0045     ext2(iSim,:) = nuTempList{iSim,8};
0046     ext3(iSim,:) = nuTempList{iSim,9};
0047 end
0048 
0049 return

Generated on Tue 05-Oct-2004 10:40:50 by m2html © 2003