Returning NaN after mean calculation?
이전 댓글 표시
Just wondring why my code is returning NaN when I use the mean fucntion? My numbers are not that big i have scaled back the number of runs from 1000 to 10 but still no change. I'm confused
clear all
close all
clc
% set up variables
no_of_calls = 60;
no_of_runs = 10;
CallTime = [];
CallLength =[];
n = ones(1,no_of_calls).*42;
E_1 = zeros(no_of_runs, no_of_calls);
call_timeDIST= makedist('Uniform');
call_lengthDIST = makedist('Poisson','lambda',3);
CallLength = zeros(no_of_runs,no_of_calls);
for i = 1:no_of_calls
for j = 1:no_of_runs
% Create distribution for calls in time
CallTime(j) = random(call_timeDIST);
% Create distribution for call length
CallLength(j,i) = random(call_lengthDIST);
% calculate A0
A_0 = 600.*(CallLength./60);
% calculate E_1 using Erlings-B Formula
E_1(j,i) = part_2(A_0(j,i), n(i));
end
% Find Mean for number of iterations
GOS = mean(E_1,2);
end
CT = sort(CallTime)';
plot(CT, GOS)
댓글 수: 2
Torsten
2022년 10월 17일
We don't know what "part_2" does with A_0(j,i) and n(i).
Cormac Carr
2022년 10월 17일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!