Hi all,
I just want to plot these data in matlab, however, I got confused about plotting
Time 1/1/2020 2/1/2020
00 - 01 46.88 36.24
01 - 02 51 32.74
02 - 03 48.26 31.22
03 - 04 35.18 28.12
04 - 05 31.8 27.68
05 - 06 30.94 27.89
06 - 07 30.88 33.13
07 - 08 30.8 41.1
08 - 09 31.6 43.54
09 - 10 32.82 44.08
10 - 11 38.26 44.51
11 - 12 44.6 46.16
12 - 13 52.26 46.22
13 - 14 46.94 45.96
14 - 15 46.94 45.1
15 - 16 46.58 44.98
16 - 17 43.42 45.42
17 - 18 58.91 47.47
18 - 19 62.55 54.16
19 - 20 50.46 47.2
20 - 21 48.28 44.73
21 - 22 42.25 37.76
22 - 23 42.16 33.8
23 - 00 37.56 32.62
Where, x axes will be from 0-24 and y-axes should be the values. so, how can I settle it in matlab where the plot must same be as attached image

 采纳的回答

KSSV
KSSV 2021-7-28
编辑:KSSV 2021-7-28
T = readtable(filename) ; % your file where data is present
x = (1:24)' ;
plot(x,T.(2),'r',x,T.(3),'b')

5 个评论

Thanks alot for your answer KSSV,
'X' is unrecognized !?
Type error..it should x. Edited the naswer.
Also, it didn't work
Vectors must be the same length.
T = readtable(filename) ; % your file where data is present
plot(T.(2),'r')
hold on
plot(T.(3),'b')
it worked, but unfortunately not as expected graph

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by