Is it possible to use range objects with the MLGetMatrix function in Excel Link?
조회 수: 3 (최근 30일)
이전 댓글 표시
I am using the Excel Link MLGetMatrix function in an Excel Macro, but I need to use use a range object returned by the VBA Cells function to specify where to place the data.
For example instead of:
MLGetMatrix "X", "Sheet1!A1"
I would like to use:
MLGetMatrix("X",Cells(1,1))
채택된 답변
MathWorks Support Team
2009년 6월 27일
This bug has been fixed in Release 2007a (R2007a). For previous product releases, read below for any possible workarounds:
The MLGetMatrix function can accept ranges expressed as strings; to use a range object, you will first need to convert it to string format.
The MLGetMatrix function in Excel Link takes two string inputs. The first input specifies the MATLAB variable name and the second input specifies the address of the Excel worksheet cell where the first element of the MATLAB variable should be written.
If you have a range object which refers to the location where you want to write your data, you can use the "Address" property of the range object to extract the string. For example:
Sub Get_Variable()
MLGetMatrix "X", Cells(3, 2).Address
MatlabRequest
End Sub
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Functions in Microsoft Excel에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!