Is there a way to generate formulas in Excel from Matlab?

  • Follow


Can Matlab write formulas into Excel?

0
Reply lunamoonmoon (258) 2/17/2010 6:17:19 PM

Luna Moon <lunamoonmoon@gmail.com> wrote in message <8b202c9b-7138-4948-8e18-7edf0b03a667@o26g2000vbd.googlegroups.com>...
> Can Matlab write formulas into Excel?

similar post, same answer.

http://www.mathworks.com/support/solutions/en/data/1-17PWC/index.html
0
Reply ade100a (320) 2/17/2010 7:45:23 PM


On Feb 17, 2:45=A0pm, "ade77 " <ade1...@gmail.com> wrote:
> Luna Moon <lunamoonm...@gmail.com> wrote in message <8b202c9b-7138-4948-8=
e18-7edf0b03a...@o26g2000vbd.googlegroups.com>...
> > Can Matlab write formulas into Excel?
>
> similar post, same answer.
>
> http://www.mathworks.com/support/solutions/en/data/1-17PWC/index.html

I have read that webpage before, where does it say how to write
formulas into Excel sheet?
0
Reply lunamoonmoon (258) 2/17/2010 7:52:39 PM

Luna Moon <lunamoonmoon@gmail.com> wrote in message <31546e44-2ede-4da9-84a7-5f60380f9323@z25g2000vbb.googlegroups.com>...
> On Feb 17, 2:45 pm, "ade77 " <ade1...@gmail.com> wrote:
> > Luna Moon <lunamoonm...@gmail.com> wrote in message <8b202c9b-7138-4948-8e18-7edf0b03a...@o26g2000vbd.googlegroups.com>...
> > > Can Matlab write formulas into Excel?
> >
> > similar post, same answer.
> >
> > http://www.mathworks.com/support/solutions/en/data/1-17PWC/index.html
> 
> I have read that webpage before, where does it say how to write
> formulas into Excel sheet?

just the same concept.
for example you want to write this formula (=POWER(C2,6)) into cell D5;

after you create your activex,

Range = Excel.Range('D5');
Range.Select % make this cell active
Range.Value = '=POWER(C2,6)' %the expression after the first equal sign is a string.

so after your excel file is completely created, if you click the cell "D5" , you will see the formula '=POWER(C2,6)', so whatever is in cell C2, will be raised to the power of 6.
0
Reply ade100a (320) 2/17/2010 8:09:06 PM

> > I have read that webpage before, where does it say how to write
> > formulas into Excel sheet?
> 
> just the same concept.
> for example you want to write this formula (=POWER(C2,6)) into cell D5;
> 
> after you create your activex,
> 
> Range = Excel.Range('D5');
> Range.Select % make this cell active
> Range.Value = '=POWER(C2,6)' %the expression after the first equal sign is a string.


I think it is better to use Range.Formula = '=...' than Range.Value in this case

Yair Altman
http://UndocumentedMatlab.com
0
Reply altmanyDEL (1124) 2/17/2010 10:22:03 PM

"Yair Altman" wrote in message <hlhq6b$5rb$1@fred.mathworks.com>...
> > > I have read that webpage before, where does it say how to write
> > > formulas into Excel sheet?
> > 
> > just the same concept.
> > for example you want to write this formula (=POWER(C2,6)) into cell D5;
> > 
> > after you create your activex,
> > 
> > Range = Excel.Range('D5');
> > Range.Select % make this cell active
> > Range.Value = '=POWER(C2,6)' %the expression after the first equal sign is a string.
> 
> 
> I think it is better to use Range.Formula = '=...' than Range.Value in this case
> 
> Yair Altman
> http://UndocumentedMatlab.com

Is there anyway to apply a formula on an entire range? meaning, apply autofill (same when you double click a cell to apply the formula on an entire column)?
0
Reply hamutaln (1) 9/13/2012 8:37:08 AM

You can do exactly this using the MATLAB Builder EX. You do not need to know Visual Basic to do this. All you need to know is to use MATLAB and Excel. Here is a video, and a link with simple steps:

http://www.youtube.com/watch?v=6W_lBysyC_o&list=PLD1D5C17EE2F7DEAB

http://www.mathworks.com/help/matlabxl/ug/deploying-your-microsoft-visual-basic-application.html;jsessionid=9d924859ad4da3c375eb7f99ca7e

The fun part is that once you have your function out of MATLAB, you don't even need to have a MATLAB installation on your computer. So you can actually run the Excel function, generated by MATLAB, in a computer that does not have MATLAB installed.

Shoot me an email for detailed steps if something is unclear.
0
Reply chetan.rawal (2) 4/11/2013 8:20:20 PM

6 Replies
74 Views

(page loaded in 0.327 seconds)

Similiar Articles:













7/28/2012 9:20:24 PM


Reply: