pls correct this simple error? i cant identify at which place trouble on my code
Show older comments
clear all;
clc;
format short;
random_no=0;
load_array=zeros(1,10);
plp_array=zeros(1,10);
slot=input('Enter the no of slot for Simulation=');
n=input('Enter the no of inputs='); %part of dest assign module
b=input('Enter the size of buffer=');
fileID = fopen('results1.txt','wt'); ............when i run this code it shows this error
??? Undefined function or method 'dest_fxn' for input arguments of
type 'double'.
Error in ==> e at 23
des=dest_fxn(n);
for load=0.1:0.1:1.0
fprintf(fileID,'\r\nFor load =%f',load); %load varying from 10% to 100%
packet=0;
tloss=0;
tload=0;
clear buffer_fxn_temp;
for run=1:slot
A=zeros(1,n); %initializing output matrix
for port=1:n
random_no=rand(1);
if random_no<load
packet=packet+1;
des=dest_fxn(n); %calling Function dest_fxn
A(1,des)=A(1,des)+1; %part of dest assign module
end
end
y=buffer_fxn_temp(n,b,A); %calling function buffer_fxn
tloss=tloss+y;
end
temp_load=uint8(load*10);
plp=tloss/packet;
load_array(1,temp_load)=load;
plp_array(1,temp_load)=plp;
fprintf(fileID,'\r\nTotal No of packet Loss=%d\r\nSum of all the packets=%d',tloss,packet);
end
semilogy(load_array,plp_array);
hold on;
grid on;
fprintf(fileID,'\n ********** End **********\n')
fclose(fileID);
1 Comment
Mischa Kim
on 7 Feb 2014
Where and how is dest_fxn defined?
Answers (0)
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!