How to plot histogram with numerical and string data with Matlab?

10 次查看(过去 30 天)
I have a csv file. It contains two column called Devices (String values) and AverageTime ( float, numeric value). I need to plot histogram, x axis: Devices, y axis: AverageTime. My code is
T=readtable('H:/Temporary/test.csv'); T.Properties.VariableNames = {'Devices' 'Time'}; Devices1=T.Devices; Time1=T.Time; hist(Devices1, Time1); But I'm getting error: Error using hist (line 48) Input arguments must be numeric. Error in test (line 5) hist(Devices1, Time1)
Please help me to plot this?
My csv file looks like: (just an example) Devices AverageTime A 10.23 B 22.38 C 78.20 D 100.002 E 57.1147

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by