present decimal values in a pie graph
古いコメントを表示
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Pie Charts についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!