Plot data with date and time as the x axis
    조회 수: 22 (최근 30일)
  
       이전 댓글 표시
    
Hello,
Can anyone help me plot this table data? I want to have the date and time as x - axis and the other variables as 6 differnent plots all in the same 
figure.

Thanks,
Amir
댓글 수: 0
채택된 답변
  Cris LaPierre
    
      
 2022년 3월 4일
        Read the table in as a table using readtable. You will want to make sure column 1 is read in as a datetime. This 'should' happen automatically, but may depend on your version of MATLAB. Once in MATLAB, you can just plot using the datetime variable as your x input. As a datetime, it will automatically show date and time.
댓글 수: 3
  Cris LaPierre
    
      
 2022년 3월 7일
				
      편집: Cris LaPierre
    
      
 2022년 3월 7일
  
			Try this syntax: stackedplot(___,'XVariable',xvar)
xlsx_name = 'C:\\Air Temperature\MQLoad (1).xlsx'
tab = readtable(xlsx_name);
stackedplot(tab,'XVariable','Var1')
If that doesn't work, please share your spreadsheet. You can attach it to your post using the paperclip icon.
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



