bar chart for an array
조회 수: 8 (최근 30일)
이전 댓글 표시
I'm trying to create a bar chart for a matrix, its a 1x30 but I only want the 0, 10th, 20th and 30th values.
I've tried many formats such as in the image but I cannot manage to get it working.
Any suggestions out there?
댓글 수: 0
채택된 답변
Ameer Hamza
2018년 5월 4일
편집: Ameer Hamza
2018년 5월 4일
I MATLAB, use the following syntax to index into an array.
bar([1 10 20 30], mean_1_1_walk([1 10 20 30]))
Also in MATLAB indexing start from 1, unlike some other programming languages (such as c/c++, java, python) where indexing starts from 0.
댓글 수: 8
Ameer Hamza
2018년 5월 5일
You can find several examples on documentation page which will help you to do this: https://www.mathworks.com/help/matlab/ref/bar.html#d119e66370.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!