i wanted to plot histogram for following
2 次查看(过去 30 天)
显示 更早的评论
status = [dosing, dosing, dosing, initializing, dosing, dosing, initializing];
I wanted to plot graph like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150978/image.jpeg)
采纳的回答
Nobel Mondal
2015-6-8
编辑:Nobel Mondal
2015-6-8
% Need to convert the input as a cell-array
>> status = {'dosing', 'dosing', 'dosing', 'initializing',...
'dosing', 'dosing', 'initializing'};
>> [count,states] = grp2idx(status);
>> hist(count,unique(count));
>> set(gca,'xTickLabel',states)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!