Seeking to improve my ability to model systems in Simulink/Simscape. Use Matlab for statistics and time series analysis. Fan of community-based learning like Matlab Answers; appreciate the help I've gotten here.
Thanks for providing this function, Erwin! One quick thing: the set function used does not support milliseconds, so those have to be set manually. To fix this issue (and keeping the Financial Toolbox dependency fix from Scott below), the t1.set... line in the current code has to be replaced with the following lines:
[Y, M, D, H, MN, S] = datevec(dn);
t1.set(Y, M-1, D, H, MN, S);
t1.set(Calendar.MILLISECOND, (S - fix(S)) * 1000 + 1);
otherwise, it seems like milliseconds get set to a random number.
26 Nov 2014
A Word report generator (ActiveX-based) in an object-oriented way
I used the addfigure function. It seems to work. I tweaked it to accept a handle (this way I don't have to worry about selecting it first) and set the style as normal. Works great.
Laurent: Thanks for this. I've been trying to learn how to manipulate word docs and your examples made it extremely easy to understand. There were some errors for office 2010 (i.e. color property doesn't exist.) You need to use ".Selection.Font.TextColor.RGB" instead.