How do I link excel to an existing MATLAB session when using Spreadsheet Link?

조회 수: 5 (최근 30일)
Currently I have a MATLAB session opened with data in the worksapce and I am trying to export that data into excel. To do this, I open excel, and then a new MATLAB session is opened along with it and they are connected. Then I use the "save" command to save the data into a file and then import the file into the newly opened MATLAB session, and then export that data into excel.
I would like to know how to skip the new MATLAB session in the middle, so I could export the data in the current MATLAB session directly into a newly opened excel.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2023년 6월 12일
편집: MathWorks Support Team 2023년 6월 23일
To have excel linked to an existing MATLAB session when using Spreadsheet Link, you need to start MATLAB with the automation flag. To do this you can open MATLAB with the command below in the command prompt:
matlab /automation /desktop
This will start MATLAB as an automation instance and display the desktop. After that if you start Excel, it should be automatically connected to this MATLAB session.
Another workaround would be writing data to Excel using ActiveX, please refer to the link below:

추가 답변 (0개)

카테고리

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

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by