Using mathcad from matlab

4 Ansichten (letzte 30 Tage)
Omer Hamburger
Omer Hamburger am 30 Mai 2016
Kommentiert: Thomas am 8 Mär. 2017
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 Kommentar
Thomas
Thomas am 8 Mär. 2017
Hello, can you provide the Mathcad file ?
Thanks

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu External Language Interfaces finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by