counting and plotting elements in a vector
3 次查看(过去 30 天)
显示 更早的评论
hi there, i want to count the number of elements in a vector and plot it right away. ex: v = [2,3,2,4,5,6,5,6,7,] the out put should be plotted right away. so the a plot should be made whos x-axis extends from 1 - 10 (y depends on counts so doesnt matter) so for the first plot, since there are no 1s...no count(or 0) is plotted then that plot is held and the count of 2 is plotted so it will be one, then next is 3 - one again, next is 2 in the vector but now we have gone up to count two so two is plotted and so on. so basically i want to plot the counts as the loop is run through the vector and the plot is updated with each loop. any help would be appreciated. thanks
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!