present decimal values in a pie graph
Afficher commentaires plus anciens
Hello, I'm struggling in a specific action in a pie graph. After I input a vector of numbers, if the sum of the numbers is bigger than 100, than the program should do the following action in a for loop.
afterwards a pie graph should be created and the numbers should be presented in their decimal value. my code works fine and creates the graph besides the decimal part. I would love to get a hand in here how to turn my values into their decimal values (I know this code won't do it, I'm not familiar with any command that would do that).
else sum(num) > 100
for i = 1 ; length(num) %for loop that takes every value, divides it by the sum of the vector and multiply by 100%
num(i) = ((num(i)/sum(num))*100);
end
pie(num);
thanks in advance.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Pie Charts dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!