how can i plot ?

1 view (last 30 days)
abtin irani
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

Accepted Answer

Star Strider
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
abtin irani
abtin irani on 20 Aug 2019
thanks you very very much sir.
Star Strider
Star Strider on 20 Aug 2019
As always, my pleasure.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!