Hi Miss simahr
I used the following code that you sent to me.
feature('COM_SafeArraySingleDim', 1)
feature('COM_PassSafeArrayByRef', 1)
SapObject=actxserver('SAP2000v16.SapObject');
SapObject.ApplicationStart
Sap=SapObject.SapModel;
Sap.File.OpenFile('C:\Users\ ... .s2k')
ret=Sap.Analyze.RunAnalysis
%--------------------- analysis results (for DEAD, LIVE,EX and Comb1) for column 100-------------------------
ret = Sap.Results.Setup.DeselectAllCasesAndCombosForOutput;
ret = Sap.Results.Setup.SetCaseSelectedForOutput('DEAD') ;
ret = Sap.Results.Setup.SetCaseSelectedForOutput('LIVE') ;
ret = Sap.Results.Setup.SetCaseSelectedForOutput('EX') ;
ret = Sap.Results.Setup.SetComboSelectedForOutput('comb1') ;
NumberResults = 0;
Obj = cellstr(' ');
Elm = cellstr(' ');
ElmSta = cellstr(' ');
ObjSta=cellstr(' ');
ACase = cellstr(' ');
StepType = cellstr(' ');
StepNum = zeros(1,1,'double');
P = zeros(1,1,'double');
V2 = zeros(1,1,'double');
V3 = zeros(1,1,'double');
T = zeros(1,1,'double');
M2 = zeros(1,1,'double');
M3 = zeros(1,1,'double');
ObjectElm = 0;
[ret,NumberResults, Obj, ObjSta, Elm, ElmSta, ACase, StepType, StepNum, P, V2, V3, T, M2, M3]=Sap.Results.FrameForce('100', ObjectElm, NumberResults, Obj, ObjSta, Elm, ElmSta, ACase, StepType, StepNum, P, V2, V3, T, M2, M3);
P
M3
%----------------------------
but it has a warning like following.
Warning: ActiveX - attempt to convert unsupported SAFEARRAY type failed - substituting NAN
Warning: ActiveX - attempt to convert unsupported SAFEARRAY type failed - substituting NAN
Warning: ActiveX - attempt to convert unsupported SAFEARRAY type failed - substituting NAN
Warning: ActiveX - attempt to convert unsupported SAFEARRAY type failed - substituting NAN
Warning: ActiveX - attempt to convert unsupported SAFEARRAY type failed - substituting NAN
Warning: ActiveX - attempt to convert unsupported SAFEARRAY type failed - substituting NAN
Warning: ActiveX - attempt to convert unsupported SAFEARRAY type failed - substituting NAN
P =
NaN
M3 =
NaN
Can you or someone else help me to get the results from sap by matlab correctly?