Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi guys
I installed Matlab "for student version"
it works , as well as my results are ready for figures ....
I have no idea about MATLAP before
how could I run "filename.m" from MATLAP editor ?
what are the commands ...
Important note:I'm using Ubuntu 12.04 (32 bit) , the simulator is
LTE-Sim, the author of the scenario that I'm working on, made the graphic files use MATLAB
Cheers.
Regards
Octave is a gpl'ed clone of matlab
and is in the ubuntu repos , well every major OS's repos
as to the commands???????
without knowing WHAT the program dose and the variables in it .
there is NO way i can tell
Code:
matlab
filename.m
"filename.m" will likely have some arguments
normally one reads the instructions for the program
and / or
" read the code"
as in read the *.m file
What dose it do ?
what are the arguments?
and so on ....
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.
Here I will summarize all my efforts to make this codes working for me using octave
I installed octave using
Code:
sudo get-apt update
sudo get-apt install octave
here I started to try so many times , using different commands ...
I used:
Code:
./makegraphs
I used:
Code:
sudo octave makegraphs.m
I usded:
Code:
octave makegraphs.m
these commands I get from wikis to use..... all of theses commands
didn't work for me, I got different errors depending on the command that I'v used....
the last cammand I used , it was like this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.