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')
댓글 수: 2
Walter Roberson
2018년 6월 21일
You and James should consider working together; https://www.mathworks.com/matlabcentral/answers/406856-how-do-ipass-a-double-by-reference-into-a-com-object-s-methods
답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!