Redsfan86 |
08-16-2014 02:42 AM |
thanks a lot
First : I tried to use Octave, but I got errors + the author of the file himself advised me to use MATLAB.
as well as I'm not sure about the codes of octave that I'm used ....
so the first question ...
1- Could you please tell me in details how to execute "anyfilename.m"
Now .. what does the file works ....
First of all , there are many files (.m) I have, not only this one
these files are responsible to generate simulation results figures for scheduling algorithms....
Here are the Full codes (makegrahs.m): this is the file that we have to run ...
Code:
clc;
close all;
clear all;
sched=[1 6 5 4]; % PF; LOG; EXP; FLS
users=[10 20 30 40];
delay=[0.04 0.06 0.08 0.1];
speed=[3 120];
test='PLRVIDEO';
for v=1:length(speed)
for ue=1:length(users)
for d=1:length(delay)
for s=1:length(sched)
dat=load(strcat('OUT/',test,'_SCHED_',num2str(sched(s)),'_UE_',num2str(users(ue)), '_V_',num2str(speed(v)),'_D_',num2str(delay(d))));
mat(s,d)=mean(dat);
end
end
t=strcat(test,'_SPEED_',num2str(speed(v)),'_UEs_',num2str(users(ue)));
y='PLR [%]';
ymax=100;
ymin=0;
plotnormal(mat',t, y, ymin, ymax)
end
end
test='TPUTVIDEO';
for v=1:length(speed)
for ue=1:length(users)
for d=1:length(delay)
for s=1:length(sched)
dat=load(strcat('OUT/',test,'_SCHED_',num2str(sched(s)),'_UE_',num2str(users(ue)), '_V_',num2str(speed(v)),'_D_',num2str(delay(d))));
mat(s,d)=mean(dat);
end
end
t=strcat(test,'_SPEED_',num2str(speed(v)),'_UEs_',num2str(users(ue)));
y='Goodput [Mbps]';
ymax=5;
mat=mat./1000000;
ymin=0;
plotnormal(mat',t, y, ymin, ymax)
end
end
test='DELVIDEO';
for v=1:length(speed)
for ue=1:length(users)
for d=1:length(delay)
for s=1:length(sched)
dat=load(strcat('OUT/',test,'_SCHED_',num2str(sched(s)),'_UE_',num2str(users(ue)), '_V_',num2str(speed(v)),'_D_',num2str(delay(d))));
mat(s,d)=mean(dat);
end
end
t=strcat(test,'_SPEED_',num2str(speed(v)),'_UEs_',num2str(users(ue)));
y='Goodput [Mbps]';
y='Packets Delay [s]';
ymax=100;
ymin=0.01;
plotlog(mat',t, y, ymin, ymax)
end
end
test='PLRVOIP';
for v=1:length(speed)
for ue=1:length(users)
for d=1:length(delay)
for s=1:length(sched)
dat=load(strcat('OUT/',test,'_SCHED_',num2str(sched(s)),'_UE_',num2str(users(ue)), '_V_',num2str(speed(v)),'_D_',num2str(delay(d))));
mat(s,d)=mean(dat);
end
end
t=strcat(test,'_SPEED_',num2str(speed(v)),'_UEs_',num2str(users(ue)));
y='PLR [%]';
ymax=20;
ymin=0;
plotnormal(mat',t, y, ymin, ymax)
end
end
test='TPUTVOIP';
for v=1:length(speed)
for ue=1:length(users)
for d=1:length(delay)
for s=1:length(sched)
dat=load(strcat('OUT/',test,'_SCHED_',num2str(sched(s)),'_UE_',num2str(users(ue)), '_V_',num2str(speed(v)),'_D_',num2str(delay(d))));
mat(s,d)=mean(dat);
end
end
t=strcat(test,'_SPEED_',num2str(speed(v)),'_UEs_',num2str(users(ue)));
y='Goodput [Mbps]';
ymax=1;
mat=mat./1000000;
ymin=0;
plotnormal(mat',t, y, ymin, ymax)
end
end
test='DELVOIP';
for v=1:length(speed)
for ue=1:length(users)
for d=1:length(delay)
for s=1:length(sched)
dat=load(strcat('OUT/',test,'_SCHED_',num2str(sched(s)),'_UE_',num2str(users(ue)), '_V_',num2str(speed(v)),'_D_',num2str(delay(d))));
mat(s,d)=mean(dat);
end
end
t=strcat(test,'_SPEED_',num2str(speed(v)),'_UEs_',num2str(users(ue)));
y='Goodput [Mbps]';
y='Packets Delay [s]';
ymax=1;
ymin=0.001;
plotlog(mat',t, y, ymin, ymax)
end
end
test='TPUTBE';
for v=1:length(speed)
for ue=1:length(users)
for d=1:length(delay)
for s=1:length(sched)
dat=load(strcat('OUT/',test,'_SCHED_',num2str(sched(s)),'_UE_',num2str(users(ue)), '_V_',num2str(speed(v)),'_D_',num2str(delay(d))));
mat(s,d)=mean(dat);
end
end
t=strcat(test,'_SPEED_',num2str(speed(v)),'_UEs_',num2str(users(ue)));
y='Goodput [Mbps]';
ymax=10;
mat=mat./1000000;
ymin=0;
plotnormal(mat',t, y, ymin, ymax)
end
end
This is the code for createfigure.m
Code:
function createfigure(ymatrix1, t, y, ymax)
figure1 = figure('Name', t);
axes1 = axes('Parent',figure1,'XTickLabel',{'10','20','30'},'XTick',[1 2 3],'FontSize',20);
box(axes1,'on');
grid(axes1,'on');
hold(axes1,'all');
% Create multiple lines using matrix input to bar
bar1 = bar(ymatrix1,'Parent',axes1);
set(bar1(1),'DisplayName','PF');
set(bar1(2),'DisplayName','FLS');
set(bar1(3),'DisplayName','EXP');
set(bar1(4),'DisplayName','LOG');
xlabel('Number of Users','FontSize',20);
ylabel(y,'FontSize',20);
ylim ([0 ymax]);
legend1 = legend(axes1,'show');
set(legend1,...
'Position',[0.794558608718962 0.753098188751188 0.0997122246143713 0.157112868804529]);
saveas(figure1, t, 'png')
plotlog.m full code
Code:
function plotlog(ymatrix1, t, y, ymin, ymax)
%CREATEFIGURE1(YMATRIX1)
% YMATRIX1: bar matrix data
% Auto-generated by MATLAB on 05-Mar-2013 21:48:14
% Create figure
figure1 = figure('Name', t);
% Create axes
axes1 = axes('Parent',figure1,'YScale','log','YMinorTick','on',...
'YMinorGrid','on',...
'XTickLabel',{'0.04','0.06','0.08','0.1'},...
'XTick',[1 2 3 4],...
'FontSize',20);
% Uncomment the following line to preserve the Y-limits of the axes
% ylim(axes1,[0.1 100]);
box(axes1,'on');
grid(axes1,'on');
hold(axes1,'all');
% Create multiple lines using matrix input to bar
bar1 = bar(ymatrix1,'BaseValue',ymin,'Parent',axes1);
set(bar1(1),'DisplayName','Proportional Fair');
set(bar1(2),'DisplayName','LOG rule');
set(bar1(3),'DisplayName','EXP rule');
set(bar1(4),'DisplayName','Frame Level Scheduler');
% Create xlabel
xlabel('Target Delay [s]','FontSize',20);
% Create ylabel
ylabel(y,'FontSize',20);
ylim ([ymin ymax])
% Create legend
legend1 = legend(axes1,'show');
set(legend1,'Location','NorthOutside');
saveas(figure1, t, 'png')
Full code for plotnormal.m
Code:
function plotnormal(ymatrix1, t, y, ymin, ymax)
%CREATEFIGURE1(YMATRIX1)
% YMATRIX1: bar matrix data
% Auto-generated by MATLAB on 05-Mar-2013 21:48:14
% Create figure
figure1 = figure('Name', t);
% Create axes
axes1 = axes('Parent',figure1,'YMinorTick','on',...
'YMinorGrid','on',...
'XTickLabel',{'0.04','0.06','0.08','0.1'},...
'XTick',[1 2 3 4],...
'FontSize',20);
% Uncomment the following line to preserve the Y-limits of the axes
% ylim(axes1,[0.1 100]);
box(axes1,'on');
grid(axes1,'on');
hold(axes1,'all');
% Create multiple lines using matrix input to bar
bar1 = bar(ymatrix1,'BaseValue',ymin,'Parent',axes1);
set(bar1(1),'DisplayName','Proportional Fair');
set(bar1(2),'DisplayName','LOG rule');
set(bar1(3),'DisplayName','EXP rule');
set(bar1(4),'DisplayName','Frame Level Scheduler');
% Create xlabel
xlabel('Target Delay [s]','FontSize',20);
% Create ylabel
ylabel(y,'FontSize',20);
ylim ([ymin ymax])
% Create legend
legend1 = legend(axes1,'show');
set(legend1,'Location','NorthOutside');
saveas(figure1, t, 'png')
These are the files for the graphic ....
according to the author:
Code:
- run simulations:
sh run.sh
- elaborate simulations' output
sh postsim.sh
- generate graphs using the makegraphs.m file (using Matlab)
I've done the first two steps , still the figures for me ....
I'v installed octave .... but I got some errors ....
So could you please help me in any way (MATLAB0 or Octave) ..
I don't care , I care about the figures....
thanks a lot
Regards.
|