Electronics

Electronics

MATLAB scripts can reference variable strings like VB scripts

    • NaplonDennis
      Subscriber
      Hello, I used the GetOutputVariableValue function in MATLAB, hoping to change 52.2 in 'FREq = 52.2ghz' into the parameter x, like this:nvar = oModule1.GetOutputVariableValue   (GG, freq='52.2GHz', PortOnly","Modal Solution Data,())n Arraynvar = oModule1.GetOutputVariableValue  ('GG', freq='x', 'PortOnly","Modal Solution Data","');nBut there would be an error as follow:nNo method 'GetOutputVariableValue' with matching signature was found for class 'interface.55f20a31_789b_4d15_bcce_82f702411155'.nDo anyone knows how to solve itn
    • Karthik R
      Administrator
      Which tool are you using? Is this HFSS? Could you please confirm this?nThanks.nKarthikn
    • NaplonDennis
      Subscriber
      Thanks you!nMy tool is Electronics Desktop 2019R2.nn
    • rtk
      Ansys Employee
      Hello-nIt seems like you have used incorrect formats for matlab.nvar = oModule1.GetOutputVariableValue  ('GG', freq='x', 'PortOnly","Modal Solution Data","'); these formats are not supported by Matlab.nYou can go for Python, if you want to do the same. nAEDT scripting document have details on how to accomplish such functions/classes/objects using Python and VB.nnHope this addressed your concern!nnBest Regards,n
    • NaplonDennis
      Subscriber
      Thank you!nI think my question can be simpilified as :nHow to translate the following vbs statement into matlab statement :nvar = oModule1.GetOutputVariableValue   (GG, freq='x', PortOnly","Modal Solution Data,()) n
    • rtk
      Ansys Employee
      nYou can find leads for this problem in one previous post -- https://forum.ansys.com/discussion/13494/hfss-script-problem#latestnI am reposting the answer here again for you : n I would suggest calling your already available scripts from MATLAB, if that makes things easier for you.nMatlab have many external interfaces from which you can call scripts in other formats like .vbs, .py etc.. and even DLLs.nYou can use 'loadlibrary' function in Matlab, if you want to call from DLLs.nAnother way is to call other COM objects from MATLAB (check here).... or use COM API within MATLAB.nSo, for your case, initialize HFSS COM object first and then proceed using MATLAB like I mentioned above.nAlso, you can call MATLAB function from VB . Check herennHope this addressed your concern!nBest Regards,nn
Viewing 5 reply threads
  • You must be logged in to reply to this topic.