Home > wafo > wdemos > itmkurs > splitload.m

splitload

PURPOSE ^

Split a switching load (e.g. switchingload.mat)

SYNOPSIS ^

[xx,x,z] = splitload(x0,tz)

DESCRIPTION ^

  SPLITLOAD Split a switching load (e.g. switchingload.mat)  
  [xx,x,z] = splitload(x0,tz)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

01 function [xx,x,z] = splitload(x0,tz)
02 % SPLITLOAD Split a switching load (e.g. switchingload.mat)  
03 % [xx,x,z] = splitload(x0,tz)
04   
05 j0 = min(find(x0(:,1)>=tz(1,1)));
06 j = max(find(x0(:,1)<tz(end,1)));
07 x = x0(j0:j,:);
08 z = 3*ones(length(x),1);
09 
10 j0 = 1;
11 for i = 1:length(tz)-1
12   j1 = max(find(x(:,1)<tz(i+1,1)));
13   z(j0:j1) = tz(i,2)*ones(j1-j0+1,1) ; 
14   j0 = j1+1;
15 end
16 for k = min(z):max(z)
17   xx{k} = x(z==k,:);
18 end
19 
20

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003