to plot a value in percentage form

7 ビュー (過去 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 Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by