plot when x variables are "strings"

조회 수: 2 (최근 30일)
alpedhuez
alpedhuez 2020년 5월 26일
편집: alpedhuez 2020년 5월 26일
I have created a following csv file
Column 1 "EST 9AM (PST 6AM)", "EST 10AM (PST 7AM)",...
Column 2 Temperature at these time
I read the file in Matlab and tried to plot them. But the error message is that "Error Using Plots: Invalid Data Argument."

채택된 답변

SayedPedram Hosseini
SayedPedram Hosseini 2020년 5월 26일
You've got to change the data type to datetime. First fecht the date column with this:
T = readtable(filename)
then change it to datetime to any format that you need. like:
T.LocalTime.Format = 'MM/dd/uuuu HH:mm:ss'
you find additional information on the documentation of datetime here: https://de.mathworks.com/help/matlab/ref/datetime.html
  댓글 수: 1
alpedhuez
alpedhuez 2020년 5월 26일
편집: alpedhuez 2020년 5월 26일
Thank you. That would be my question. I read "EST 9AM (PST 6AM)",... from csv. How can one convert it to datetime format?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by