Generating an excel file from a timetable

조회 수: 8 (최근 30일)
Ayman Fathy
Ayman Fathy 2018년 10월 16일
댓글: Guillaume 2018년 10월 16일
I am trying to generate an excel file from a timetable. The timetable is an array of 2 columns, 1 contains the date and the other column data. I used this code: filename2 = 'daily'; xlswrite(filename2,temp_Hourly,'A1')
I am getting this error: Input data must be a numeric, cell, or logical array. can someone help please?
  댓글 수: 2
madhan ravi
madhan ravi 2018년 10월 16일
Datas??
Ayman Fathy
Ayman Fathy 2018년 10월 16일
My final result in the code is a timetable generated from the timetable function. It contains 2 columns, 1 is the date and the other is temperature data. Is there a way to export this timetable into excel?

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

답변 (1개)

KSSV
KSSV 2018년 10월 16일
편집: KSSV 2018년 10월 16일
Read about writetable
% generate some dates
t1 = datetime(2018,10,1,0,0,0);
t2 = datetime(2018,10,20,0,0,0);
time = (t1:t2)' ;
% some random temperatures
Temperature = rand(size(time)) ;
% write table to excel
T = table(time,Temperature) ;
writetable(T,'test.xlsx')
  댓글 수: 1
Guillaume
Guillaume 2018년 10월 16일
Yes, the function to write tables/timetables to a file (excel or text) is writetable, not xlswrite.
In fact, forget xlsread and xlswrite. They've both been superseded by readtable and writetable respectively, which are a lot more powerful.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by