Serving the Quantitative Finance Community

 
User avatar
AppleNY
Topic Author
Posts: 0
Joined: May 26th, 2006, 4:14 pm

Matlab programs in Excel

June 17th, 2006, 5:30 pm

Is it possible to write a program in Matlab and then somehow to use it in Excel, e.g. Matlab program is test(parameter1, parameter2, parameter3) and in Excel one can then write:=test(1,2,3)??
 
User avatar
majhzh
Posts: 0
Joined: November 2nd, 2003, 2:19 pm

Matlab programs in Excel

June 18th, 2006, 3:23 am

certainly, pls refer to Excel Link for Matlab in the help document. It is easy to call a function or variables from matlab in Excel.But once you open the Excel and open the matlab excel link vba macro. The matlab commond window will automatically pop out. and there are some command listed in excel medu window such as getmatrix...
 
User avatar
janickg
Posts: 0
Joined: August 3rd, 2004, 1:13 pm

Matlab programs in Excel

June 26th, 2006, 11:58 am

you can also use the =matlabfcn(...) in the Excel formula edit bar, assuming you have Excel Link already going.
 
User avatar
bajazet
Posts: 0
Joined: June 15th, 2006, 7:32 pm

Matlab programs in Excel

June 26th, 2006, 4:46 pm

I'm curious to know how robust the matlab compiler is for excel. I'm thinking of building web apps using the matlab compiler, and I want something that won't croak on me(too often). What are people's experiences with this?
 
User avatar
ZmeiGorynych
Posts: 6
Joined: July 10th, 2005, 11:46 am

Matlab programs in Excel

June 28th, 2006, 4:07 pm

I've used the compiler (not the excel bit), it hasn't broken on me yet. The key pain was that under unix you have to compile under the same unix/linux flavor as on the machine it'll run to; plus you have to install matlab runtime libs on the latter machine. While in windows both have worked seamlessly for me, it took some time and pain to get them working in unixland (large corporate network).So if you're planning to host the stuff yourself, should be a breeze; if using paid or otherwise remote hosting, careful investigation is advised. And what do web apps and Excel have in common? Any combination of matlab, xl and web services that I can think of is pretty stomach-curdling
Last edited by ZmeiGorynych on June 27th, 2006, 10:00 pm, edited 1 time in total.
 
User avatar
spursfan
Posts: 2
Joined: October 7th, 2001, 3:43 pm

Matlab programs in Excel

May 6th, 2007, 4:43 pm

But, as I've just found out, you can't use matlabfcn directly that involves complex numbers (text strings) in Excel - you have to put the data into MATLAB, create a complex number then call the MATLAB function then return the answer to Excel Another thing that I'm trying to get to work is using the matlabfcn function to call user-defined .m functions as opposed to the regular built-in MATLAB commands - hopefully I should be able to put a path somewhere in the matlabfcn command or, failing that, move the .m file that I want to use to a specified directory but no joy - any help much appreciated
 
User avatar
ZmeiGorynych
Posts: 6
Joined: July 10th, 2005, 11:46 am

Matlab programs in Excel

May 7th, 2007, 11:52 am

Call 'addpath' with appropriate args using matlabfcn at the beginning of each session?
Last edited by ZmeiGorynych on May 6th, 2007, 10:00 pm, edited 1 time in total.
 
User avatar
spursfan
Posts: 2
Joined: October 7th, 2001, 3:43 pm

Matlab programs in Excel

May 7th, 2007, 12:38 pm

good try but my path with the .m file is already there when I do a path command
 
User avatar
ZmeiGorynych
Posts: 6
Joined: July 10th, 2005, 11:46 am

Matlab programs in Excel

May 8th, 2007, 6:10 am

eval('yourcommand')?
 
User avatar
spursfan
Posts: 2
Joined: October 7th, 2001, 3:43 pm

Matlab programs in Excel

May 8th, 2007, 11:42 am

I should have been using this function with the output range and then input range =matlabsub("fft","W36:W163",P36163)