필터 지우기
필터 지우기

Write Matlab data to an Excel sheet

조회 수: 1 (최근 30일)
Anounymous85
Anounymous85 2019년 6월 27일
답변: sdas sda 2019년 6월 28일
Hello,
I am trying to write the output data, which i am getting as the results of my code into an excel sheet.
My problem is, eventhough the results are getting written into the excel sheet it only gives me the last set of data.
** The resluts are getting written only into one row. So, they are getting replaced.
Can someone advice me how can i write these data into row by row?
I am using the following code.
T = table(a,b,date);
filename = 'data.xlsx';
writetable(T,filename,'Sheet',1,'Range','A1:A500')
Thanks!

답변 (3개)

KSSV
KSSV 2019년 6월 27일
T = table(a,b,date);
filename = 'data.xlsx';
writetable(T,filename,'Sheet',1)
  댓글 수: 2
Anounymous85
Anounymous85 2019년 6월 28일
Still i can get the last set of data only. The last set of data gets written to the excel sheet as shown below.
Capture.PNG
KSSV
KSSV 2019년 6월 28일
Are you running any loop ? Inside the loop you are writitng? Show us the full code.

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


Shameer Parmar
Shameer Parmar 2019년 6월 27일
편집: Shameer Parmar 2019년 6월 27일
try to expand the given rang like.. 'A1:Z500'
use
writetable(T,filename,'Sheet',1);
OR
writetable(T,filename,'Sheet',1, 'Range','A1:Z500');
  댓글 수: 1
Anounymous85
Anounymous85 2019년 6월 28일
Still i can get the last set of data only (i used the first code). The last set of data gets written to the excel sheet as shown below.
Capture.PNG

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


sdas sda
sdas sda 2019년 6월 28일
I think that. The range term may varies as the number of loop varies. The number of loop is one,the range term may be A2:C2.The number of loop is two, the range term may be A3:C3,and so on. Then the previous data may not be overwrited by the new data that will be writed into the Excel as inputs. I suppose that.

카테고리

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