?? plots.m
字號:
function Plots(sortWLAN, start, num, xlabel, ylabel, colourfit, colour, type, line, RSSI, PER)
%This function ->
% Plots: Creates a series of plots based on the input data, where
% the majority of inputs are passed from Graph.m.
% NOTE: This function requires the MATLAB program Count_num.m to be in the
% same working directory
i = start - 1;
while(i <= num)
i = i + 1;
[first, last] = Count_num(sortWLAN(line,:), i)
if(first == 0)
test = i;
continue;
end
dist = sortWLAN(3,first:last);
if(RSSI == 1)
rssi = sortWLAN(4,first:last);
else
rssi = sortWLAN(2,first:last); %PER
end
wgt = sortWLAN(5,first:last);
if(type == 1)
coorelation = corr2(dist, rssi)
first = first - 1;
if (RSSI == 1)
Graph(dist,rssi, 0, 12, wgt, xlabel, ylabel, ['Average RSSI against distance with ' num2str(i) ' operating WLAN using ', num2str(last - first), ' samples'], colourfit,colour,RSSI,PER,1);
else
Graph(dist,rssi, 0, 12, wgt, xlabel, ylabel, ['Distance against PER with ' num2str(i) ' operating WLAN using ', num2str(last - first), ' samples'], colourfit,colour,RSSI,PER,1);
end
end
if(type == 2)
i
coorelation = corr2(dist, rssi)
switch i
case 2
word = 'Bathroom';
case 3
word = 'Bedroom';
case 4
word = 'Hallway';
case 5
word = 'Kitchen';
case 6
word = 'Laundry';
case 7
word = 'Living';
case 8
word = 'Recess';
case 9
word = 'Toilet';
case 10
word = 'Office';
case 11
word = 'Unknown';
case 12
word = 'Garage';
case 13
word = 'Other';
end
first = first - 1;
if(RSSI == 1)
hold on
Graph(dist,rssi, 0, 12, wgt, xlabel, ylabel, ['Average RSSI for calculated Distance in the ' word ' using ', num2str(last - first), ' samples'], colourfit, colour,RSSI,PER,1);
hold off
else
Graph(rssi,dist, 0, 12, wgt, xlabel, ylabel, ['PER for calculated Distance in the ' word ' using ', num2str(last - first), ' samples'], colourfit, colour,RSSI,PER,1);
end
% pause;
end
if(type == 3)
coorelation = corr2(dist, rssi)
switch i
case 0
word = 'without ducted airconditioning';
case 1
word = 'with ducted airconditioning';
end
first = first - 1;
Graph(dist,rssi, 0, 12, wgt, xlabel, ylabel, ['Average RSSI for calculated Distance ' word ' using ', num2str(last - first), ' samples'], colourfit, colour,RSSI,PER,1);
end
if(type == 4)
switch i
case 0
word = '9 or more people within dwelling';
case 1
word = '1 person within dwelling';
case 2
word = '2 people within dwelling';
case 3
word = '3 people within dwelling';
case 4
word = '4 people within dwelling';
case 5
word = '5 people within dwelling';
case 6
word = '6 people within dwelling';
case 7
word = '7 people within dwelling';
case 8
word = '8 people within dwelling';
case 9
word = '9 people within dwelling';
end
Graph(dist,rssi, 0, 12, wgt, xlabel, ylabel, ['Average RSSI for calculated Distance with ' word ' using ', num2str(last - first), ' samples'], colourfit, colour,RSSI,PER,1);
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -