to plot a value in percentage form

조회 수: 10 (최근 30일)
suchismita
suchismita 2011년 6월 16일
Sir,I have done some programming for my project and numerically i am almost getting the desired value.my problem is i have to plot it in percentage but i m unable to do it.i want it in histogram form.suppose i am getting "G=14.6".how can i plot it in % form in y-axis.plzz help me sir.its urgent. Expecting a favorable reply. Thanking u SUCHI.
  댓글 수: 2
Sean de Wolski
Sean de Wolski 2011년 6월 16일
What does your data look like?
suchismita
suchismita 2011년 6월 18일
hello sir ,actually i have to find out the battery lifetime of mobile nodes.the paper i have chosen showing the graph as: y axis represent the average remaining life time of mobile nodes in percentage.According to the equations given in the paper i m getting the numerical values but cant understand how to plot this numeric value in percentage.is there any method for doing this? i m attaching a part of the prog.
N=2;M=1;k=5;
:
:
for j=1:k
for i=1:N
lij=pj/pij;
end
end
for j=1:k
for i=1:N
ltj=cumsum(lij*xij);
L=max(cumsum(ltj));
end
i ve given pj & pij some random value as mentioned in the paper.& xij=1.
I am getting a single value as output for "L".As pj & pij are random each time i m executing m getting different values for L.Suppose i m getting output as 23.4.my problem is how to plot it in percentage form in y-axis ranging from 0 to 100%.Nothing is mentioned in the paper regarding this.Is there any method for doing this??
pllzzz help sir.
Thanking u.
Suchi

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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 6월 16일
bar(G ./ sum(G) .* 100)
maybe.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by