如何将图像从MATLAB导出到Excel中的某个单元格?

时间:2017-09-07 13:45:51

标签: excel matlab

我想将在MATLAB中绘制的数字导出到Excel中的指定单元格中。我尝试了this,但它不适用于最后一行,我收到以下错误:

  

没有合适的方法,属性或字段图片类   Interface.Microsoft_Excel_15.0_Object_Library._Worksheet。

代码是:

% Open Excel file.
objExcel = actxserver('Excel.Application');
objExcel.Workbooks.Open(fullfile('D:\MATLAB', 'x1.xlsx'));
oWB = objExcel.Workbooks.Add();
oSheet = oWB.ActiveSheet;
oSheet.Range('A1').Select;
oSheet.Pictures.Insert('D:\MATLAB\v.jpg').Select();  % This line does not work for me and I get the error above!

任何人都可以帮助我吗?有没有其他方法可以将图像从MATLAB导入Excel?提前谢谢!

0 个答案:

没有答案