Run MATLAB with "ExliSamp. XLS document
"
Run time stays in the first row: Function CurveFit (aData, sTarget1 sTarget2, sTarget3)
The Function CurveFit (aData, sTarget1 sTarget2, sTarget3)
'the MATLAB regression and curve fitting macro
MLPutMatrix "data", aData
MLEvalString "y=data (:, 3)"
MLEvalString "n=length (y)"
MLEvalString "e=ones (n, 1)"
MLEvalString "A=data (:, 1:2) [e]"
MLEvalString beta=A \ "y"
MLEvalString "fit=A * beta"
MLEvalString "[the] y, k=sort (y)"
MLEvalString "fit=fit (k)"
MLEvalString "(p, S)=polyfit (1: n, y ', 5)
"MLEvalString "newfit=polyval (p, 1: n, S) '"
MLEvalString "plot (1: n, y, 'bo', 1: n, fit, 'r:', 1: n, newfit," g "); Legend (' data ', 'fit' and 'newfit')
""Y", MLGetMatrix sTarget1
MLGetMatrix "fit", sTarget2
MLGetMatrix newfit, sTarget3
End the Function
CodePudding user response:
Estimate the matlab not call upMLPutMatrix
This function is not found
CodePudding user response: