Using mathcad from matlab
Afficher commentaires plus anciens
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 commentaire
Thomas
le 8 Mar 2017
Hello, can you provide the Mathcad file ?
Thanks
Réponses (0)
Catégories
En savoir plus sur External Language Interfaces dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!