MATLAB Answers

Using mathcad from matlab

11 views (last 30 days)
Omer Hamburger
Omer Hamburger on 30 May 2016
Commented: Thomas on 8 Mar 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 Comment
Thomas
Thomas on 8 Mar 2017
Hello, can you provide the Mathcad file ?
Thanks

Sign in to comment.

Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!