Using mathcad from matlab

7 ビュー (過去 30 日間)
Omer Hamburger
Omer Hamburger 2016 年 5 月 30 日
コメント済み: Thomas 2017 年 3 月 8 日
Hello guys,
I am trying to run a script from mathcad from the matlab.
In my script I have few variables that I change in every time I call the script, and I have 2 outputs I wish to save into matlab.
I use this code for it:
h = actxserver('Mathcad.Application');
sht = h.worksheet.Open('C:\Users\Omer\Documents\MATLAB\Booster\betagrouptcalc.xmcd');
sht.SetValue('e1',e1);
sht.SetValue('e2',e2);
sht.SetValue('b',beta);
sht.SetValue('N',Nlayers);
sht.SetValue('kk',Rint);
test1=sht.GetValue('vc').Real;
test2=sht.GetValue('out2').Real;
betagroup=test1;
betaenergy=test2;
I keep getting the same error message:
"Error using Interface.Mathcad_Automation_API.IMathcadWorksheet2/GetValue
Invoke Error, Dispatch Exception:
Source: Mathcad.Worksheet.1
Description: The requested value was not found in the worksheet.
Error in mathcad (line 7)
test1=sht.GetValue('vc').Real;"
Can someone please help me understand what is the problem and how to solve it?
Thank you very much,
Omer.
  1 件のコメント
Thomas
Thomas 2017 年 3 月 8 日
Hello, can you provide the Mathcad file ?
Thanks

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeExternal Language Interfaces についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by