September 22nd, 2005, 8:55 am
Hi,just wondering if you had similar experiences with Matlab's Fixed Income Toolbox + Excel, any suggestions would be appreciated:I recently re-wrote some VBA functions as Matlab m-files, replacing VBA's PRICE() function with Matlab's equivalent function 'bndprice'.I then compiled the m-file functions into a Type Library .dll using Excel Builder and sourced the .dll from Excel.As expected, the .dll functions called from Excel were faster than the original VBA functions, where the functions involved matrix operations and did not involve the bond pricing function.But the new functions that relied on 'bndprice' were a lot slower than the original VBA functions that relied on PRICE().To check that bndprice was in fact a lot slower than PRICE() I did this:1. A test m-file called bndprice 1000 times (using same inputs) and returned the time taken to complete: 25 sec.2. A VBA macro called ActiveSheet.Calculate 1000 times on a sheet that has only one PRICE() function with fixed inputs: 3 sec(This is without setting Application.Screenupdating=False which speeds VBA up).So on an Excel sheet with lots of calculations such as DV01's, it seems best to stick to a bond pricing function other than the Matlab one!Ideally the .dll would be making use of PRICE() but this doesn't seem possible for a matlab-based library...Thanks for taking a look.