How do I send data to excel formula input cell , and receive the output cell data back to Matlab command window. Any examples please help thanks ?

3 views (last 30 days)
Varun Reddy MARPADGA
Varun Reddy MARPADGA on 6 Jun 2022
Edited: Jon on 6 Jun 2022
How do I send data to excel formula input cell , and receive the output cell data back to Matlab command window. Any examples please help thaks.
  1 Comment
dpb
dpb on 6 Jun 2022
writetable and readtable are the currently in vogue high-level routines -- there's any number of examples in the doc and Answers using Excel extensively for reference.
You can poke at Excel innards with ActiveX and do virtually anything that can be done -- this entails using the native Excel object model and can be very frustrating. There are a lot of examples at Answers that use it as well plus some submission on FEX that provide some user interfaces for various tasks.
I'll turn the Q? around -- give us some concrete examples of what you're trying to accomplish.

Sign in to comment.

Answers (1)

Jon
Jon on 6 Jun 2022
Edited: Jon on 6 Jun 2022
Assuming it is really required that you go back and forth between Excel and MATLAB you can use MATLAB's spreadsheet link product https://www.mathworks.com/products/spreadsheet-link.html
Often however as @dpb points out you can just read the data in from the spreadsheet perform what ever math you want with this data and then finally write it back to some other cells, using readtable, writetable (or even readmatrix, writematrix).
The former approach (using Spreadsheet Link) is probably only needed if you have users that work exclusively with Excel (not MATLAB) and you want to provide some nice functionality in the background using the power of MATLAB

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!