MATLAB: How to add chart in a specific sheet in an excel workbook via Matlab

chart;excelimportsheet

I would like to add a chart in a specific sheet in an excel workbook via Matlab? Is this possible?

Best Answer

There are a few ways of doing this:
- If you use MATLAB Spreadsheet link Spreadsheet link this will enable you from Excel to call MATLAB and bring in MATLAB plots
- Some people like using Excel graphs and use MATLAB to refresh the data. So if have the data in MATLAB, and writetable or xlswrite to a specific sheet, then you can have the Excel create a chart based on that range, all you need is to update the chart.
- It is also possible to control Excel from MATLAB via the COM interface, however this takes a little more work.
- It is also possible to create an excel add-in with MATLAB Compiler SDK, that takes your MATLAB function and embeds it in Excel.