필터 지우기
필터 지우기

'import class' statement not working inside a function

조회 수: 1 (최근 30일)
gujax
gujax 2012년 10월 4일
Hi, I have a function declaration. In that function I add .NET library. When I try to use import, Matlab gives error 'function writem() not found'. On debugging I find that the debugger does not go to that line statement 'import..' but bypasses it leading to ther error. Any ideas why?
However, once I remove function definition and run it as a script everything works. Or else if I write 'something_hello.writem()', it works- obviously.
I am running R2009a.
Thanks
Here is the code
function something()
try
NET.addAssembly('something_hello.dll');
catch e
e.message
if(isa(e, 'NET.NetException'))
e.ExceptionObject
end
end
import something_hello.*;
dev=writem();

답변 (0개)

카테고리

Help CenterFile Exchange에서 Getting Started with Microsoft .NET에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by