to plot a value in percentage form

2 visualizzazioni (ultimi 30 giorni)
suchismita
suchismita il 16 Giu 2011
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 Commenti
Sean de Wolski
Sean de Wolski il 16 Giu 2011
What does your data look like?
suchismita
suchismita il 18 Giu 2011
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

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 16 Giu 2011
bar(G ./ sum(G) .* 100)
maybe.

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by