필터 지우기
필터 지우기

Exporting from matlab to excel with macro?

조회 수: 3 (최근 30일)
Matija Kosak
Matija Kosak 2018년 7월 6일
답변: Guillaume 2018년 7월 6일
Hi, I have matrix(200x3) I want to export in excel spreadsheet in which I already have 5 lines of text.
---
StartLoft
StartCurve
EndLoft
EndCurve
End
-----
I would like to export my matrix between StartCurve and EndLoft (that is A3 in spreadsheet), but I want for EndLoft, EndCurve, End to move down.
When I try to place matrix in A3 it just delete's EndLoft, EndCurve, End, and I want them moved down to be after Matrix. Is that possible?
  댓글 수: 1
Aarti Dwivedi
Aarti Dwivedi 2018년 7월 6일
https://www.mathworks.com/matlabcentral/answers/178989-open-edit-and-save-excel-file-with-matlab Have you tried the solution here? It appears to me that these two questions are similar.

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

채택된 답변

Guillaume
Guillaume 2018년 7월 6일
To achieve exactly what you want, you'd have to automate excel from matlab through actxserver. If you're familiar with excel VBA, it's fairly easy to do. If not, you have a steep learning curve ahead of you.
However, I don't see why you can't simply write your matrix, stomping over the EndLoft, EndCurve and End line, then simply write these lines after your matrix:
xlswrite(yourexcelfile, [num2cell(yourmatrix); {'EndLoft', [], []; 'EndCurve', [], []; 'End', [], []}, 'Sheet1', 'A3');

추가 답변 (0개)

카테고리

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