How to pass a double value by reference

4 次查看(过去 30 天)
We are using a COM Function that takes output doubles as an argument. When I tried to pass regular Matlab double values, I get this error.
Error using COM.Afgrow_Application/invoke
Error: Type mismatch, argument 1
I think this is because the type of the variable is “ out double ” Which is passed by reference.
%This Line Launches the afgrow application
afgrow = actxserver('Afgrow.Application');
%Set Units to English, 1 for metric
set(afgrow, 'Units', 0);
%Sets Spectrum to Constant Amplitude
invoke(afgrow, 'ConstAmplitudeSpectrum', 0)
%Set Multiplication Factor to 13.5
set(afgrow, 'SMF', 13.5);
%Set Initial Crack Length in C Direction to .05
set(afgrow, 'Visible', 1);
%invoke(afgrow, 'RunFrozPredict', cyc)
invoke(afgrow,'model',1030);
le=cell(2,2);
le=[0.05,0.05;0.05,0.05];
cyc = 0;
fc = 0;
fkc = 0;
fa =0;
fka = 0;
fct =0;
fkct =0;
invoke(afgrow, 'RunFrozPredict',cyc, fc, fkc, fa, fka, fct,fkc);
invoke(afgrow, 'CalculateBetas',le)
invoke(afgrow, 'RunPredict')

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Use COM Objects in MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by