필터 지우기
필터 지우기

Urgent: Help with plot

조회 수: 3 (최근 30일)
kenifeh
kenifeh 2011년 9월 26일
Someone help me to plot. I want M on x-axis and T on y-asix. Find the script below
CBW=12; % kbit/sec
Ps=160; %voice payload size
for M=1:100 %number of voice sources
lambda= M*CBW/Ps %arrival rate of a single voice source
Ls=4096; % bandwidth of link, kbit/s
Hl=240; %Total size of header
Ts=20*10^-6;
mu=Ls/(Ps+Hl+Ls*Ts); %service rate of a voice packet
nu=M*CBW*(Ps+Hl+Ls*Ts);
de=Ps*Ls;
rho=nu/de %factor of utilization
a=1/mu;
b=rho/2*(1-rho)*mu;
T=a+b
end
  댓글 수: 1
Jan
Jan 2011년 9월 26일
Please use meaningful subject and tags. For the ones who ask the question, it is always "urgent", for the ones who answer, it is never "urgent". And all questions concern "matlab".

댓글을 달려면 로그인하십시오.

채택된 답변

Daniel Shub
Daniel Shub 2011년 9월 26일
A couple of small tweaks will get you there ...
Replace
T=a+b
with
T(M)=a+b;
T(M) % If you want to see the new value of T on every loop.
Then plot the data after your loop:
plot(1:100, T)
If I don't say it, someone else will yell at me, you might also want to initialize T. Before your loop add:
T = zeros(100, 1);
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 9월 26일
WE WOULDN'T YELL AT YOU. We'd just embarrass you about it. Repeatedly. ;-)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by