GetVariable from function in visual basic script
조회 수: 4 (최근 30일)
이전 댓글 표시
I am using the matlab automation server to call a function from a vb script
Result = Matlab.Execute("z=first([2 7],[1 5])") this is a function that ads the values of the 2 vectors and this works
Matlab.GetVariable("z","base") But when i try to get the variable from this function, i get the following error
error: cannot use quotation marks when calling a sub value
Does anybody knows what seems to be the problem with this? Or is not possible to get a variable from a function
thanks in advance
댓글 수: 0
채택된 답변
Friedrich
2013년 4월 10일
편집: Friedrich
2013년 4월 10일
Hi,
when I do this it works fine:
Set ml = CreateObject("MATLAB.application")
ml.Execute ("z = rand(1)")
Val = ml.GetVariable("z", "base")
msgbox Val
Val then contains the value of z (choosed rand(1) to get one value only so that i can display it easily). What is your full code?
댓글 수: 4
Friedrich
2013년 4월 16일
Look at the IDL signature:
HRESULT GetVariable([in] BSTR varname, [in] BSTR workspace, [out, retval] VARIANT* pdata)
It's a Variant. When you like to put some values into a file, i would do it from the MATLAB side because its more easy than doing it in VBS.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!