clear all;
one=0;
two=0;
three=0;
while one==0
clear all;
two=0;
three=0;
connector on;
m = mobiledev;
picture = imread('C:\Users\user\Desktop\Aaron\01.png');
image(picture);
pause(2);
R = unidrnd(2)
if R==1
picture = imread('C:\Users\user\Desktop\Aaron\IMAG0543.jpg');
image(picture);
pause(0.01);
picture = imread('C:\Users\user\Desktop\Aaron\IMAG0544.jpg');
image(picture);
pause(0.01);
picture = imread('C:\Users\user\Desktop\Aaron\IMAG0545.jpg');
image(picture);
discardlogs(m);
m.Logging = 1;
pause(0.3);
m.Logging = 0;
[a,t]=orientlog(m);
pitch1=a(:,2);
pitch2 = max(pitch1);
assignin('base','x',pitch2);
load_system('untitled2');
sim('untitled2');
now = max(i);
if now==1
picture = imread('C:\Users\user\Desktop\Aaron\03.jpg');
image(picture);
three=1;
end;
end;
if R==2
picture = imread('C:\Users\user\Desktop\Aaron\IMAG0546.jpg');
image(picture);
pause(0.01);
picture = imread('C:\Users\user\Desktop\Aaron\IMAG0547.jpg');
image(picture);
pause(0.01);
picture = imread('C:\Users\user\Desktop\Aaron\IMAG0548.jpg');
image(picture);
two=1;
discardlogs(m);
m.Logging = 1;
pause(0.3);
m.Logging = 0;
[a,t]=orientlog(m);
pitch1=a(:,2);
pitch2 = max(pitch1);
assignin('base','x',pitch2);
load_system('untitled2');
sim('untitled2');
now = max(i);
if now==2
picture = imread('C:\Users\user\Desktop\Aaron\03.jpg');
image(picture);
three=1;
end;
end;
if three==0
pause(1);
picture = imread('C:\Users\user\Desktop\Aaron\05.png');
image(picture);
discardlogs(m);
m.Logging = 1;
pause(0.8);
m.Logging = 0;
[ac, tac] = accellog(m);
x = ac(:,1);
throw1 = max(x);
x1 = ac(:,2);
throw2 = max(x1);
x2 = ac(:,3);
throw3 = max(x2);
assignin('base','y1',throw1);
assignin('base','y2',throw2);
assignin('base','y3',throw3);
load_system('untitled1');
sim('untitled1');
now1 = max(z);
if now1==1
picture = imread('C:\Users\user\Desktop\Aaron\03.jpg');
image(picture);
three=1;
end;
if now1==2
picture = imread('C:\Users\user\Desktop\Aaron\04.jpg');
image(picture);
three=1;
end;
end;
one=1;
end;