Exporting data to excel every time a program is run

조회 수: 4 (최근 30일)
Con
Con 2013년 2월 11일
I want to be able to write data to an excel spreadsheet after running a program. I know how to do this once, but I want to be able to run the program many times and add the data to excel each time, without overwriting the previous data in the spread sheet. For example:
a = x^2;
If I run this for x=1, I can get my answer and export it to excel ok. But if I run the exact same program again for x=2, I want it to write the answer to the same spreadsheet as the first one without overwriting the original data. My program is much more complex than this obviously but I want to get a general sense of how it's done.
I would prefer methods that don't involve any loops.

채택된 답변

ChristianW
ChristianW 2013년 2월 11일
x = 1:100;
a = x.^2;
xlswrite('xls_test',a)

추가 답변 (1개)

Srinivas
Srinivas 2013년 2월 11일
편집: Srinivas 2013년 2월 11일
look for the sheet and range options in xlswrite
'I want it to write the answer to the same spreadsheet as the first one without overwriting the original data' what does this mean, you want to shift the previous output downwards.

카테고리

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