MATLAB scripts can reference variable strings like VB scripts

NaplonDennisNaplonDennis Member
edited October 12 in Electronics

Hello, I used the GetOutputVariableValue function in MATLAB, hoping to change 52.2 in 'FREq = 52.2ghz' into the parameter x, like this:

var = oModule1.GetOutputVariableValue   ("GG", "freq='52.2GHz'", "PortOnly","Modal Solution Data",Array())

⬇️

var = oModule1.GetOutputVariableValue  ('GG', "freq='x'", 'PortOnly','Modal Solution Data','');

But there would be an error as follow:

No method 'GetOutputVariableValue' with matching signature was found for class 'interface.55f20a31_789b_4d15_bcce_82f702411155'.

Do anyone knows how to solve it

Answers

  • Which tool are you using? Is this HFSS? Could you please confirm this?

    Thanks.

    Karthik

  • Thanks you!

    My tool is Electronics Desktop 2019R2.

  • rtkrtk Pune, IndiaForum Coordinator

    Hello-

    It seems like you have used incorrect formats for matlab.

    "var = oModule1.GetOutputVariableValue  ('GG', "freq='x'", 'PortOnly','Modal Solution Data','');" these formats are not supported by Matlab.

    You can go for Python, if you want to do the same.

    AEDT scripting document have details on how to accomplish such functions/classes/objects using Python and VB.


    Hope this addressed your concern!


    Best Regards,

  • Thank you!

    I think my question can be simpilified as :

    How to translate the following vbs statement into matlab statement :

    var = oModule1.GetOutputVariableValue   ("GG", "freq='x'", "PortOnly","Modal Solution Data",Array())

  • rtkrtk Pune, IndiaForum Coordinator
    edited October 19

    Hello @NaplonDennis ,

    You can find leads for this problem in one previous post -- https://forum.ansys.com/discussion/13494/hfss-script-problem#latest

    I am reposting the answer here again for you :

    I would suggest calling your already available scripts from MATLAB, if that makes things easier for you.

    Matlab have many external interfaces from which you can call scripts in other formats like .vbs, .py etc.. and even DLLs.

    You can use 'loadlibrary' function in Matlab, if you want to call from DLLs.

    Another way is to call other COM objects from MATLAB (check here).... or use COM API within MATLAB.

    So, for your case, initialize HFSS COM object first and then proceed using MATLAB like I mentioned above.

    Also, you can call MATLAB function from VB . Check here


    Hope this addressed your concern!

    Best Regards,

Sign In or Register to comment.