2

I am developing a Matlab application for myself and for others using a GUI on Excel (for ease of use but also because some data processing need to be done in Excel).

To simplify, here are all the parts making up my application:

  • Part 1: Excel GUI with run settings
  • Part 2: Matlab program creating data results and images
  • Part 3: Excel GUI with Matlab data & image results and aditionnal Excel data processing

Currently, when others need to use it, they give me the run settings (Part 1), I run the Matlab program for them (Part 2) and give them the data, images and my last Excel GUI (Part3).


I am trying to improve the situation by combining the parts above. I see 2 options:

  • Option 1: Running Matlab from Excel (Spreadsheet Link EX Toolbox) therefore having Part1 & Part2 together
    • => would be more for me (I have Matlab, and I can see more info from running my Matlab code)
  • Option 2: Packaging it all: Part 1+2+3 in an executable (MATLAB Compiler Toolbox)
    • => would be for my end users (no Matlab needed)

Now my questions:

  1. Can I (Should I? Should I not?) do both options? or am I over complicating everything? and should not use Excel Link toolbox at all?
  2. Do I need Matlab Builder EX to achieve Option 2? (therefore creating an Add-in) or could I also achieve this with the toolboxes: Excel Link + Compiler? (No Add-in, but VBA code?)

Cheers!

Nico
  • 83
  • 1
  • 10
  • You can run MATLAB from Excel (Spreadsheet Link EX), Excel from MATLAB (COM Automation), or deploy a standalone application with a MATLAB GUI that export all results as Excel file (MATLAB Compiler). I guess it's up to you which one you prefer – Amro Jul 24 '12 at 16:04
  • Thanks for your answer! Can I combine running MATLAB from Excel (Spreadsheet Link EX) and a compiler solution? – Nico Jul 24 '12 at 20:44
  • One more question: Using the compiler, will I still be able to run all my macros in Excel? or is that only for the "Spreadsheet Link EX" solution? – Nico Jul 24 '12 at 20:55

2 Answers2

2

If you choose to use the MATLAB Compiler, the following is what I imagine the steps would be

  • create a GUI in MATLAB. It will present an interface that allows the user to input some settings. It also has a "RUN" button that will run your MATLAB program with those parameters.

  • at the end of your alorithm, use COM automation to open Excel and programmatically fill tables with the results of the previous step. You could add snapshots of any generated MATLAB figures and plots to the excel file (see here for an example) or simply save as separate image files. You could even add VBA macros to the sheet.

  • Deploy the above as a standalone application. It will not depend on MATLAB (only the freely available MCR runtime has to be installed by the user).

  • The user runs your application, and use it to generate the Excel file. Now the user can optionally open this file, and manually perform any final data manipulation.

If you want additional integration, you could use the "Spreadsheet Link EX" toolbox.

HTH

Community
  • 1
  • 1
Amro
  • 123,847
  • 25
  • 243
  • 454
  • That's a very detailed answer! Thanks! So I can use the "Spreadsheet Link EX" toolbox then compile it all. I could this way use Excel as an interface to input settings. But then I suppose I have to run the VBA macros from Matlab...? – Nico Jul 24 '12 at 22:06
  • @Nico: being more MATLAB inclined myself, I would write the whole interface in MATLAB, with any processing needed implemented as MATLAB functions. Excel would only be used to open the resulting report file. If the user wants to customize the input settings, they can just run the program again and specify them in the MATLAB GUI. Of course having it deployed as standalone executable, your end-users do not need to have or use MATLAB at all.. I have to mention that I've never used the "Spreadsheet Link EX" toolbox before, so I don't know what how that works in combination with the MATLAB Compiler. – Amro Jul 24 '12 at 22:18
0

There is a great answer which kind of answer my question. MATLAB Compiler vs MATLAB Coder

Basically:

  • For R2014b and ealier version: It is possible to produce Excel add-ins with the "MATLAB Builder EX for Excel" toolbox

  • From R2015a (recent release): The toolbox "MATLAB Compiler" can now produce Excel add-ins

This simplify things a lot!

Nico (answering his own question :-) )

Community
  • 1
  • 1
Nico
  • 83
  • 1
  • 10