다음은 Excel 시트에 MATLAB Figure를 삽입하기 위해 Mathworks Support Team (아래 링크)에서 제공 한 코드입니다. 시트를 원하는 용지로 업데이트해야 할 수도 있습니다. 상기 응답
% Create sample image from figure
img = 'figure1.png';
plot(1:10);
print('-dpng', img);
% Get handle to Excel COM Server
Excel = actxserver('Excel.Application');
% Set it to visible
set(Excel,'Visible',1);
% Add a Workbook
Workbooks = Excel.Workbooks;
Workbook = invoke(Workbooks, 'Add');
% Get a handle to Sheets and select Sheet 1
Sheets = Excel.ActiveWorkBook.Sheets;
Sheet1 = get(Sheets, 'Item', 1);
Sheet1.Activate;
% Alternative 1 BEGIN.
% Get a handle to Shapes for Sheet 1
Shapes = Sheet1.Shapes;
% Add image
Shapes.AddPicture([pwd '\' img] ,0,1,400,18,300,235);
% Alternative 1 END.
% Alternative 2 BEGIN.
% Add image
Sheet1.invoke('Pictures').Insert([pwd '\' img]);
% Alternative 2 END.
% Save the workbook and Close Excel
invoke(Workbook, 'SaveAs', [pwd '\myfile.xls']);
invoke(Excel, 'Quit');
% In the above code (Alternative 1), Excel's Shapes.AddPicture Method is used to insert a figure in the Excel Sheet - Mathworks.
Link
: H K.Berg 의해
함수 img2xlsx
- 신규 또는 기존 XLSX 파일에 하나 또는 다수의 이미지 (들)를 전송한다) MATLAB 중심부로부터 될 수 downloaded
Linux 또는 Windows에서 작업 하시겠습니까? – bushmills