how can i plot ?
1 view (last 30 days)
Show older comments
abtin irani
on 19 Aug 2019
Commented: Star Strider
on 20 Aug 2019
I have on matrix such as A=[ 2.8866 2.5708 2.9381 2.6234 2.7873 2.8535 3.5818 4.1817 3.6535 4.6312 4.2028 4.4109 3.6008 4.4279 3.8003 3.7995 4.3140 4.4061 5.2382 4.5073 4.2002 3.9283 3.1146 3.0891]. A is one matrix 24*1.each element of matrix is value of losses for each hour a day.for example for hour between 0 ,1 losses is 2.8866 for hour between 1 ,2 the losses is 2.5708. how can i plot losses for 24 hours?
thanks
0 Comments
Accepted Answer
Star Strider
on 19 Aug 2019
Try this:
A=[2.8866 2.5708 2.9381 2.6234 2.7873 2.8535 3.5818 4.1817 3.6535 4.6312 4.2028 4.4109 3.6008 4.4279 3.8003 3.7995 4.3140 4.4061 5.2382 4.5073 4.2002 3.9283 3.1146 3.0891];
Hours = 0.5:23.5;
figure
stairs(Hours, A)
axis([0.5 23.5 0 6])
set(gca, 'XTick',Hours, 'XTickLabel',(0:23))
grid
xlabel('Hours')
ylabel('Loss')
15 Comments
More Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!