How to prevent xlswrite to overwrite the present values?

조회 수: 2 (최근 30일)
Jayanta Deb
Jayanta Deb 2017년 4월 5일
댓글: Walter Roberson 2017년 4월 5일
Hello Everyone, I have some variables which need to get copied in an excel sheet. The variables gets changed every time I execute the program.Now when I try it with the XLSWRITE it over writes the previous value, but I need to retain the previous value and need to store the new value after the previous or old value in a specific column. How to do that? It will be much helpful if we are able to store the variables in a specific columns of an excel sheet. Say for variable A i should be able to store it in A1, B in B1 etc... Thanks in advance
  댓글 수: 3
Jayanta Deb
Jayanta Deb 2017년 4월 5일
Hi Stephen, Yes I read, but cant see the appropriate solution. I am able to get the data in my excel but when i again run the script the newly obtained data over writes the previous value which should not be the case. thanks :)
Walter Roberson
Walter Roberson 2017년 4월 5일
Give a different xlRange option the next time.
Notice the hint:
If you do not specify sheet, then xlRange must include both corners and a colon character, even for a single cell (such as 'D2:D2'). Otherwise, xlswrite interprets the input as a worksheet name (such as 'D2').

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

답변 (1개)

Walter Roberson
Walter Roberson 2017년 4월 5일
"xlswrite(filename,A,xlRange) writes to the rectangular region specified by xlRange in the first worksheet of the workbook. Use Excel range syntax, such as 'A1:C3'."

카테고리

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