Integrating MATLAB with Excel

Hello!
I have a DCF model, which is Excel spread-sheet. I have put all assumptions of my model in separate sheet.
I want to run a Monte-Carlo simulation of this assumptions.
Ex I need to do the following: 1) Matlab will generate numbers according to specific distribution. 2) Then, Matlab will insert numbers in Excel spreadsheet. 3) Excel will recalcualte my model and build a distribution chart.
Is it possible to do this? Thank you!

답변 (1개)

Image Analyst
Image Analyst 2012년 11월 25일

0 개 추천

Yes. You can just use xlswrite() to throw your data into your Excel workbook in the proper rows. Then when you open up the workbook in Excel, your model will be recalculated. If you need anything fancier than that, what is it? If so, you'll have to use ActiveX. I have a simple demo but doing anything fancy can be quite a chore because you need to figure out what the ActiveX method of Excel is that does what you want to do.

댓글 수: 4

terance
terance 2012년 11월 25일
For instance, I have run 10000 times Monte-Carlo simulation does this imply that I have to open 10000 times my Excel spread - sheet in order to recalculate my model?
Image Analyst
Image Analyst 2012년 11월 25일
No. Just save up all your results in a matrix or cell array and then write it all one in just one call to imwrite.
terance
terance 2012년 11월 25일
thank for your answer! unfortunately, xlswrite won't work on Mac ...
Image Analyst
Image Analyst 2012년 11월 25일
Are you sure? I didn't see that exclusion in my documentation. If so, then call the Mathworks and ask them for an equivalent function to xlswrite that works on the Mac.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2012년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by