필터 지우기
필터 지우기

Plotting timetable data in a barchart

조회 수: 18 (최근 30일)
Sydney Adams
Sydney Adams 2021년 2월 12일
댓글: Sydney Adams 2021년 2월 12일
Hi there,
I am a bit new to matlab but I am trying to plot data in a timetable. My data below is the date, average temperature and the standard deviation. Any ideas on how I would plot a bar graph of date on the x axis and temperature on the y? I was not sure if I had to convert my data from the timetable to either a string or back to a vector. I currently am recieving an error stating
A table variable subscript must be a numeric array containing real positive integers, a logical array, a character vector,
a string array, or a cell array of character vectors.
Any advice is greatly appreciated!!

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 2월 12일
You forgot to share your code, but it appears you are indexing your timetable incorrectly. See this page on how to access data in a table. Something like this should work.
bar(dataTT.t,dataTT.Temperature)
  댓글 수: 1
Sydney Adams
Sydney Adams 2021년 2월 12일
Yes, sorry I was just trying to determine the best approach to the plot. Thank you!! This worked!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by