MATLAB: How to create vector after import data from .xls using for loops

forif statementxlsread

First I using command xlsread to import some data from excel and got vector row (or column it's never mind), then I try to create new matrix using for loops and if command, but I have problem, because I don't know how to do that… 🙂
Example: I import this
x=[1 5 3 7 10 10 10 15 4 8 3 5 11 19 10 10 10]
I want to create something like this:
a=[1 5 3 7] and b=[15 4 8 3 5 11 19]
,and new x=[mean(a) mean(b)]
It's necessary to use loops because every excel file that I import have different number of cell, for example: data from new excel is
x1=[1 2 3 10 10 10 4 5 6 7 8 9 11 12 13 10 10 10]
That the reason why I need block of code. Number 10 that is repeated is area that separate group of number, and I wanna to use that condition to create new vectors.
Thanks for your help.

Best Answer

Thank everyone for trying to help me, but I find solution by my self. Maybe is little complicated, but it works, and that is most important... :)
I use "xlsread" command to import data from excel and I get matrix x1, then I use for loop to get my new matrix x2.
Code:
x2=zeros(13,7);
% caunters
m=1; n=1; t=1;
for k=m:length(x1)
if x1(k,:)~=100
x2(t,n)=x1(k,1);
t=t+1;
else if (x1(k,:)==100 && (x1(k+1,:)==100 && x1(k+2,:)==100))
m=k+3;
n=n+1;
t=1;
continue
end
end
end