how to write time from excel date to matlab
Introduced in R2014b
data types Dates and Time language fundamentals MATLAB
Example 5: Bond Cash Flow and Time Mapping
Example 5 illustrates the use of the MATLAB Financial Toolbox and Excel Link to compute a set of cash flow amounts and dates given a portfolio of five bonds whose maturity dates and coupon rates are known.
Make A18 the active cell. Press F2, then Enter to execute the Excel Link function that transfers the column vector Maturity to MATLAB. Make A19 the active cell to transfer the column vector Coupon Rate to MATLAB. Make A20 the active cell to transfer the settlement date to MATLAB. Execute the functions in cells A23 and A24 to use the Financial Toolbox to compute cash flow amounts and dates. Now execute the functions in cells A27 through A29 to transform the dates into string form contained in a cell array. Execute the functions in cells A32 through A34 to transfer the data to Excel.
Most of these Matlab m-files are written by me. They have been used extensively and so should be quite robust.
If you are familiar with my Utility Library then use the LEFT column below. If you are a first time user, then browse down the RIGHT column and learn more details about the different m-files.
If you have suggestions for what might be useful generic code and doesn’t exist in the public domain, e-mail me and when I have time I’ll develop it for you and e-mail it back or upload it for public access. As an example, the 2 columns below were constructed automatically using MakeHTMLContents.m (see below) which uses a combination of HTML and Matlab programming knowledge to create something that is a truly useful timesaver.
I strongly suggest that you save these files in a brand new directory called C:MatlabUtilities (Windows) or /Matlab/Utilities/ (UNIX)
WARNING! If you don’t have Matlab installed, and click on one of the code files, it will probably open up in this window.