| Richard 2007-08-30, 8:59 pm |
| Hi All,
How, in Excel, do I pull in a Maxtix one column at a time,
without creating loads of dummy variables?
What I want to do is:
MLGetMatrix("mymatrix(:,x)","AA1")
What I have to do is:
MLEvalString("temp = mymatrix(:,x)")
MLGetMatrix("temp","AA1")
Except that this won't duplicate across cells properly
because as temp is revised across the columns of mymatrix,
so ALL of the MLGetMatrix calls are updated as well!
So I end up making a long-winded series of calls:
MLEvalString("temp1 = mymatrix(:,1)")
MLGetMatrix("temp1","AA1")
MLEvalString("temp2 = mymatrix(:,2)")
MLGetMatrix("temp2","AB1")
etc...
And now I have lots of tempx variables, which if I try to
subsequently clear, destroys the previous imports.
I'm loathe to incorporate XLSREAD/XLSWRITE into the Matlab
function that I'm calling because I want to preserve
functional flexibility i.e. I might want to call the
function from another worksheet or workbook.
At the end of the day, I have a fully-developed, highly
flexible and consequently exceedingly complicated Excel
workbook that I'm trying to augment, simplify and make more
robust using Matlab, but I just can't seem to make the Excel
Link Toolbox work FOR me. Is the only way forward to create
compiled and embedded functions for Excel?
|