Hi,
I am trying to split some data in x,y,z:
x = [351;333;337;341;346;350;354;359;363;368;372;377]; y = [145;180;182;184;186;188;190;192;194;195;197;198]; z = [31;31;30;28;28;26;24;23;21;20;19;18];
based on the values of another array named data:
data = [0,0,0,2,0,0,1,0,0,0,0,0];
So that when data = 2, the following values of x, y and z are calculated until data = 1. So in this case the data would be split into the following:
When data hits equal to 2:
x = [351;333;337;341]; y = [145;180;182;184]; z = [31;31;30;28];
And then up until data = 1:
x = [346;350;354]; y = [186;188;190]; z = [28;26;24];
and finally the after 1..
x = [359;363;368;372;377]; y = [192;194;195;197;198]; z = [23;21;20;19;18];
However I am really struggling getting this to work, it either extrapolates x, y and z when data is equal to 2 or brings up errors. Any help would be appreciated.
Cheers
Best Answer